package models

import "encoding/xml"

type JYApplyEnvelope struct {
	XMLName xml.Name    `xml:"soap:Envelope"`
	Soap    string      `xml:"xmlns:soap,attr"`
	Xsi     string      `xml:"xmlns:xsi,attr"`
	Xsd     string      `xml:"xmlns:xsd,attr"`
	Body    JYApplyBody `xml:"soap:Body"`
}

type JYApplyBody struct {
	XMLName         xml.Name        `xml:"soap:Body"`
	InspectApplyReq InspectApplyReq `xml:"InspectApplyByInstituteItemCode"`
}

type InspectApplyReq struct {
	XMLName         xml.Name `xml:"http://tempuri.org/ InspectApplyByInstituteItemCode"`
	ApiKey          string   `xml:"apiKey"`
	Apply           JYApply  `xml:"apply"`
	ApplyDetailList struct {
		CustomerApplyDetail []CustomerApplyDetail `xml:"CustomerApplyDetail"`
	} `xml:"applyDetailList"`
	//ApplyDetailList []JYApplyDetail    `xml:"applyDetailList>JYApplyDetail"`
	ApplyAdditional *JYApplyAdditional `xml:"applyAdditional,omitempty"`
}

type EnvelopeFour struct {
	XMLName xml.Name         `xml:"http://schemas.xmlsoap.org/soap/envelope/ Envelope"`
	Body    EnvelopeBodyFour `xml:"Body"`
}

type EnvelopeBodyFour struct {
	InspectApplyByInstituteItemCodeResponse InspectApplyByInstituteItemCodeResponse `xml:"InspectApplyByInstituteItemCodeResponse"`
}

type InspectApplyByInstituteItemCodeResponse struct {
	XMLName      xml.Name `xml:"http://tempuri.org/ InspectApplyByInstituteItemCodeResponse"`
	InspectApply string   `xml:"InspectApplyByInstituteItemCodeResult"`
}

type InspectApplyData struct {
	Res           int           `json:"Res"`
	Error         string        `json:"Error"`
	JYApplyResult JYApplyResult `json:"Data"`
}

type JYApply struct {
	XMLName      xml.Name `xml:"apply"`
	PatientName  string   `xml:"PatientName"`
	Sex          string   `xml:"Sex"`
	Age          string   `xml:"Age"`
	AgeUnit      string   `xml:"AgeUnit"`
	RegisterCode string   `xml:"RegisterCode"`
	Diagnosis    string   `xml:"Diagnosis"`
	Ward         string   `xml:"Ward"`
	BedCode      string   `xml:"BedCode"`
	SendDoctor   string   `xml:"SendDoctor"`
	PatientType  int      `xml:"PatientType"`
	PatientPhone string   `xml:"PatientPhone"`
}

type CustomerApplyDetail struct {
	RowIndex               int64  `xml:"RowIndex"`
	CustomerChargeItemCode string `xml:"CustomerChargeItemCode"`
	TakeSampleTime         string `xml:"TakeSampleTime"`
	Barcode                string `xml:"Barcode"`
	CustomerBarcode        string `xml:"CustomerBarcode"`
	Comment                string `xml:"Comment"`
}
type JYApplyResult struct {
	ApplyCode   string  `xml:"ApplyCode"`
	TotalAmount float64 `xml:"TotalAmount"`
}
type JYApplyAdditional struct {
}