当前位置: 首页>>代码示例>>Java>>正文


Java XmlCalendar类代码示例

本文整理汇总了Java中org.apache.xmlbeans.XmlCalendar的典型用法代码示例。如果您正苦于以下问题:Java XmlCalendar类的具体用法?Java XmlCalendar怎么用?Java XmlCalendar使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


XmlCalendar类属于org.apache.xmlbeans包,在下文中一共展示了XmlCalendar类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: parseForecastRecord

import org.apache.xmlbeans.XmlCalendar; //导入依赖的package包/类
private void parseForecastRecord(MeteorologicalAerodromeForecastRecordTypeImpl forecastRecordType, TimeObjectPropertyType phenomenonTime, boolean isChangeForecast) {
    if (isChangeForecast) {
        String changeIndicator = forecastRecordType.getChangeIndicator().toString();
        if ("BECOMING".equalsIgnoreCase(changeIndicator)) {
            tacResult.append("BCMG" + SPACE);
        } else if ("TEMPORARY_FLUCTUATIONS".equalsIgnoreCase(changeIndicator)) {
            tacResult.append("TEMPO" + SPACE);
        } else if ("FROM".equalsIgnoreCase(changeIndicator)) {
            tacResult.append("FM" + SPACE);
        } else if ("TO".equalsIgnoreCase(changeIndicator)) {
            tacResult.append("TO" + SPACE);
        }
        Date beginTime = ((XmlCalendar) ((TimePeriodTypeImpl) phenomenonTime.getAbstractTimeObject()).getBeginPosition().getObjectValue()).getTime();
        Date endTime = ((XmlCalendar) ((TimePeriodTypeImpl) phenomenonTime.getAbstractTimeObject()).getEndPosition().getObjectValue()).getTime();
        setValidTime(beginTime, endTime);
    }
    parseWindInformation(forecastRecordType);
    parseHorizontalVisibility(forecastRecordType);
    parseWeatherInformation(forecastRecordType);
    parseSkyCondition(forecastRecordType);
    parseWindSheer(forecastRecordType);
}
 
开发者ID:saeidrastak,项目名称:IWXXMConverter,代码行数:23,代码来源:TAFConverter.java

示例2: setDateAndType

import org.apache.xmlbeans.XmlCalendar; //导入依赖的package包/类
/**
 * METAR: hourly (scheduled) report; SPECI: special
 * (unscheduled) report.
 *
 * @return
 */
private DateTime setDateAndType() {
    Date phenomenonTime;

    if (isMetar()) {
        phenomenonTime = ((XmlCalendar) ((TimeInstantTypeImpl) metarDocument.getMeteorologicalAerodromeObservationReport()
                .getObservation().getOMObservation().getPhenomenonTime().getAbstractTimeObject()).
                getTimePosition().getObjectValue()).getTime();
    } else {
        phenomenonTime = ((XmlCalendar) ((TimeInstantTypeImpl) speciDocument.getMeteorologicalAerodromeObservationReport()
                .getObservation().getOMObservation().getPhenomenonTime().getAbstractTimeObject()).
                getTimePosition().getObjectValue()).getTime();
    }
    DateTime dateTime = new DateTime(phenomenonTime, DateTimeZone.UTC);
    tacResult.append(phenomenonTime + NEW_LINE);
    tacResult.append(tacType + SPACE);
    return dateTime;
}
 
开发者ID:saeidrastak,项目名称:IWXXMConverter,代码行数:24,代码来源:MetarSPECIConverter.java

示例3: setTime

import org.apache.xmlbeans.XmlCalendar; //导入依赖的package包/类
private void setTime(TimeObjectPropertyType phenomenonTime) {
    Object dateTime = ((TimeInstantTypeImpl) phenomenonTime.getAbstractTimeObject()).getTimePosition().getObjectValue();
    if (dateTime instanceof String) {
        String dateTimeStr = (String) dateTime;
        String[] ts = dateTimeStr.split("-")[2].split("T")[1].split(":");
        String hour = ts[0].length() == 1 ? "0" + ts[0] : ts[0];
        String minute = ts[1].length() == 1 ? "0" + ts[1] : ts[1];
        tacResult.append(hour + minute + "Z ");
    } else if (dateTime instanceof XmlCalendar) {
        XmlCalendar xmlCalendar = (XmlCalendar) dateTime;
        DateTime newDateTime = new DateTime(xmlCalendar.getTime(), DateTimeZone.UTC);
        String hourOfDay = String.valueOf(newDateTime.getHourOfDay());
        String minuteOfHour = String.valueOf(newDateTime.getMinuteOfHour());
        hourOfDay = hourOfDay.length() == 1 ? "0" + hourOfDay : hourOfDay;
        minuteOfHour = minuteOfHour.length() == 1 ? "0" + minuteOfHour : minuteOfHour;
        tacResult.append(hourOfDay + minuteOfHour + "Z ");
    }
}
 
开发者ID:saeidrastak,项目名称:IWXXMConverter,代码行数:19,代码来源:SIGMETConverter.java

示例4: setValidityPeriod

import org.apache.xmlbeans.XmlCalendar; //导入依赖的package包/类
private void setValidityPeriod() {

        TimePeriodType timePeriod = getSigmet().getValidPeriod().getTimePeriod();
        if (timePeriod != null) {
            Date beginDate = ((XmlCalendar) timePeriod.getBeginPosition().getObjectValue()).getTime();
            Date endDate = ((XmlCalendar) timePeriod.getEndPosition().getObjectValue()).getTime();
            DateTime beginDateTime = new DateTime(beginDate, DateTimeZone.UTC);
            DateTime endDateTime = new DateTime(endDate, DateTimeZone.UTC);

            tacResult.append("VALID" + SPACE);
            tacResult.append(getDate(beginDateTime)).append("/");
            tacResult.append(getDate(endDateTime)).append(SPACE);
        } else {
            String[] split = getSigmet().getValidPeriod().getHref().split("-");
            String fromDateTime = split[2];
            String toDateTime = split[3];
            fromDateTime = getDateTimeFormat(fromDateTime);
            toDateTime = getDateTimeFormat(toDateTime);
            tacResult.append("VALID" + SPACE);
            tacResult.append(fromDateTime).append("/");
            tacResult.append(toDateTime).append(SPACE);

        }
    }
 
开发者ID:saeidrastak,项目名称:IWXXMConverter,代码行数:25,代码来源:SIGMETConverter.java

示例5: populateProblem

import org.apache.xmlbeans.XmlCalendar; //导入依赖的package包/类
private void populateProblem(VisitData visitData, Dxresearch dx) {
	
	if(!"icd9".equals(dx.getCodingSystem())) {
		return;
	}
	
	HealthProblem problem = visitData.addNewHealthProblem();
	
	
	problem.setProblemDiagnosisCode(dx.getDxresearchCode());
	
	problem.setProblemDiagnosisCodeSystem(ProblemsDiagnosisCodeSystem.ICD_9);
	
	
	CodingSystemManager csm = SpringUtils.getBean(CodingSystemManager.class);
	String descr = csm.getCodeDescription(dx.getCodingSystem(), dx.getDxresearchCode());
	if(descr != null) {
		problem.setProblemDiagnosisName(descr);
	}
	problem.setProblemStatus(String.valueOf(dx.getStatus()));
	
	problem.setProblemDiagnosisDate(new XmlCalendar(dateFormatter.format(dx.getStartDate())));
	/*
	problem.setProblemOnsetDate(arg0);
	*/
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:27,代码来源:BORNWbCsdXmlGenerator.java

示例6: parseOriginDateTime

import org.apache.xmlbeans.XmlCalendar; //导入依赖的package包/类
private void parseOriginDateTime() {

        Date time = ((XmlCalendar) tafDocument.getTAF().getIssueTime().getTimeInstant().getTimePosition().getObjectValue()).getTime();
        DateTime dateTime = new DateTime(time, DateTimeZone.UTC);
        tacResult.append(CommonUtils.convertToTwoDigit(dateTime.getDayOfMonth()));
        tacResult.append(CommonUtils.convertToTwoDigit(dateTime.getHourOfDay()));
        tacResult.append(CommonUtils.convertToTwoDigit(dateTime.getMinuteOfHour()));
        tacResult.append("Z" + SPACE);

    }
 
开发者ID:saeidrastak,项目名称:IWXXMConverter,代码行数:11,代码来源:TAFConverter.java

示例7: generateNonTimestampDate

import org.apache.xmlbeans.XmlCalendar; //导入依赖的package包/类
private Calendar generateNonTimestampDate(String strDate) {
	String[] parts = strDate.split("-");
	if(!(parts.length==3)) {
		return null;
	}
	//XmlDateTime xmlDateTime = XmlDateTime.Factory.newInstance();
	Calendar xmlCalendar = new XmlCalendar();
	xmlCalendar.set(Calendar.YEAR, Integer.parseInt(parts[0]));
	xmlCalendar.set(Calendar.MONTH, Integer.parseInt(parts[1])-1);
	xmlCalendar.set(Calendar.DATE, Integer.parseInt(parts[2]));
	//xmlDateTime.setCalendarValue(xmlCalendar);
	
	return xmlCalendar;
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:15,代码来源:BORNWbXmlGenerator.java

示例8: addReferral

import org.apache.xmlbeans.XmlCalendar; //导入依赖的package包/类
private void addReferral(PatientInfo patientInfo, Integer demographicNo, ConsultationRequest consult, String mappedCategory ) {
	Referral referral = patientInfo.addNewReferral();
	
	Demographic demographic = demographicDao.getDemographic(demographicNo.toString());
	Provider mrp = providerDao.getProvider(demographic.getProviderNo());
	ConsultationServices service = consultationServiceDao.find(consult.getServiceId());
	ProfessionalSpecialist professionalSpecialist = consult.getProfessionalSpecialist();
	Provider provider = providerDao.getProvider(consult.getProviderNo());
	
	if(mrp != null) {
		referral.setPrimaryPhysician(demographic.getProviderNo());
		referral.setPrimaryPhysicianType(PrimaryPhysicianType.X_3);
	}
	
	
	setReferralCategory(referral.addNewReferralCategory(),(mappedCategory==null)?service.getServiceDesc():mappedCategory);

	if(referral.getReferralCategory().getReferralCategoryName().equals(ReferralCategory.UNKN)) {
		referral.setReferralCategoryOther(service.getServiceDesc());
	}
	
	referral.setReferralDate(new XmlCalendar(dateFormatter.format(consult.getReferralDate())));

	referral.setReferralStatus(getStatusText(consult.getStatus()));
	referral.setReferralUrgency(consult.getUrgency());
	
	if(professionalSpecialist != null) {
		referral.setReferredToPerson(professionalSpecialist.getLastName() + ", " + professionalSpecialist.getFirstName());
	}
	
	referral.setReferringProvider(provider.getProviderNo());
	referral.setReferringProviderType(ReferringProviderType.X_3);
	
	if(consult.getSource() != null) {
		referral.setAssociatedRourke(getAssociatedRourke(consult.getSource()));
	}
	/*
	referral.setReferredToSite(arg0);
	*/
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:41,代码来源:BORNWbCsdXmlGenerator.java

示例9: populateDrug

import org.apache.xmlbeans.XmlCalendar; //导入依赖的package包/类
private void populateDrug(VisitData visitData, Drug drug) {
	Medication medication = visitData.addNewMedication();

	if(drug.getBrandName() != null && !drug.getBrandName().isEmpty()) {
		medication.setMedicationName(drug.getBrandName());
	}
	
	if(medication.getMedicationName()==null || medication.getMedicationName().isEmpty()) {
		medication.setMedicationName(drug.getCustomName());
	}
	
	if(medication.getMedicationName()==null || medication.getMedicationName().isEmpty()) {
		medication.setMedicationName(drug.getGenericName());
	}
	
	if(medication.getMedicationName()==null || medication.getMedicationName().isEmpty()) {
		logger.warn("Could not find name for this drug! " + drug.getId());
	}
	
	if(drug.getRegionalIdentifier() != null && !drug.getRegionalIdentifier().isEmpty()) {
		try {
			medication.setMedicationDIN(drug.getRegionalIdentifier());
		} catch(NumberFormatException e) {
			logger.warn("regional identifier is not a number (id="+drug.getId()+")");
		}
	}
	
	if(drug.getRefillQuantity() != null) {
		medication.setMedicationNumberofRefills(drug.getRefillQuantity()+"");
	}
	/*
	medication.setMedicationDosage(arg0);
	medication.setMedicationDrugStrength(arg0);
	
	medication.setMedicationFrequency(arg0);
	*/
	medication.setMedicationStartDate(new XmlCalendar(dateFormatter.format(drug.getRxDate())));
	
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:40,代码来源:BORNWbCsdXmlGenerator.java

示例10: populateImmunizationData

import org.apache.xmlbeans.XmlCalendar; //导入依赖的package包/类
private void populateImmunizationData(PatientInfo patientInfo, Integer demographicNo) {
	List<Prevention> preventions = preventionDao.findActiveByDemoId(demographicNo);

	if (preventions.isEmpty()) {
		return;
	}

	ImmunizationData immunizationData = patientInfo.addNewImmunizationData();
	
	
	for(Prevention prevention:preventions) {
		Vaccine vaccine = immunizationData.addNewVaccine();
		
		List<PreventionExt> exts = preventionExtDao.findByPreventionId(prevention.getId());
		vaccine.setDateReceived(new XmlCalendar(dateFormatter.format(prevention.getPreventionDate())));
		vaccine.setVaccineName(prevention.getPreventionType()); 
		/*
		immunizationData.setVaccineDIN(arg0);
		immunizationData.setDoseNum(arg0);
		immunizationData.setExpiryDate(arg0);
		immunizationData.setInitials(arg0);
		immunizationData.setInjectionSite(arg0);
		*/
		for(PreventionExt ext:exts) {
			if("lot".equals(ext.getkeyval())) {
				vaccine.setLotNumber(ext.getVal());
			} else if("comments".equals(ext.getkeyval())) {
				vaccine.setComments(ext.getVal());
			}
		}
		
		
		
		
	}

}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:38,代码来源:BORNWbCsdXmlGenerator.java

示例11: parseValidPeriodDateTime

import org.apache.xmlbeans.XmlCalendar; //导入依赖的package包/类
private void parseValidPeriodDateTime() {
    Date beginTime = ((XmlCalendar) tafDocument.getTAF().getValidTime().getTimePeriod().getBeginPosition().getObjectValue()).getTime();
    Date endTime = ((XmlCalendar) tafDocument.getTAF().getValidTime().getTimePeriod().getEndPosition().getObjectValue()).getTime();
    setValidTime(beginTime, endTime);
}
 
开发者ID:saeidrastak,项目名称:IWXXMConverter,代码行数:6,代码来源:TAFConverter.java

示例12: propulatePatientInfoFromDemographic

import org.apache.xmlbeans.XmlCalendar; //导入依赖的package包/类
private void propulatePatientInfoFromDemographic(PatientInfo patientInfo) {
	//Mandatory fields
	Demographic demographic = demographicDao.getDemographic(demographicNo);

	patientInfo.setUniqueVendorIDSequence(demographicNo);
	patientInfo.setFirstName(demographic.getFirstName());
	patientInfo.setLastName(demographic.getLastName());
	patientInfo.setDOB(new XmlCalendar(demographic.getBirthDayAsString()));

	if ("M".equals(demographic.getSex())) patientInfo.setGender(Gender.M);
	else if ("F".equals(demographic.getSex())) patientInfo.setGender(Gender.F);
	else patientInfo.setGender(Gender.U);
	
	patientInfo.setChartNumber(String.valueOf(demographic.getDemographicNo()));
	
	if (StringUtils.filled(demographic.getHin())) patientInfo.setHealthCardNum(demographic.getHin());
	else patientInfo.setHealthCardNum("0");
	
	patientInfo.setHealthCardType(0);
	if (StringUtils.filled(demographic.getHcType())) {
		if (demographic.getHcType().equals("ON")) patientInfo.setHealthCardType(1);
		if (demographic.getHcType().equals("QC")) patientInfo.setHealthCardType(2);
	}
	//end: Mandatory fields
	
	if (StringUtils.filled(demographic.getAddress())) patientInfo.setResidentAddressLine1(demographic.getAddress());
	if (StringUtils.filled(demographic.getCity())) patientInfo.setResidentCity(demographic.getCity());
	if (StringUtils.filled(demographic.getProvince())) {
		String province = demographic.getProvince();
		if (province.equals("AB")) patientInfo.setResidentCountryProvince(CountryProvince.CA_AB);
		else if (province.equals("BC")) patientInfo.setResidentCountryProvince(CountryProvince.CA_BC);
		else if (province.equals("MB")) patientInfo.setResidentCountryProvince(CountryProvince.CA_MB);
		else if (province.equals("NB")) patientInfo.setResidentCountryProvince(CountryProvince.CA_NB);
		else if (province.equals("NL")) patientInfo.setResidentCountryProvince(CountryProvince.CA_NL);
		else if (province.equals("NT")) patientInfo.setResidentCountryProvince(CountryProvince.CA_NT);
		else if (province.equals("NS")) patientInfo.setResidentCountryProvince(CountryProvince.CA_NS);
		else if (province.equals("NU")) patientInfo.setResidentCountryProvince(CountryProvince.CA_NU);
		else if (province.equals("ON")) patientInfo.setResidentCountryProvince(CountryProvince.CA_ON);
		else if (province.equals("PE")) patientInfo.setResidentCountryProvince(CountryProvince.CA_PE);
		else if (province.equals("QC")) patientInfo.setResidentCountryProvince(CountryProvince.CA_QC);
		else if (province.equals("SK")) patientInfo.setResidentCountryProvince(CountryProvince.CA_SK);
		else if (province.equals("YT")) patientInfo.setResidentCountryProvince(CountryProvince.CA_YT);
		else if (province.startsWith("US")) patientInfo.setResidentCountryProvince(CountryProvince.USA);
		else patientInfo.setResidentCountryProvince(CountryProvince.UNKN);
	}
	if (StringUtils.filled(demographic.getPostal())) {
		patientInfo.setResidentPostalCode(demographic.getPostal().replace(" ", ""));
	}
	
	Provider provider = providerDao.getProvider(demographic.getProviderNo());
	if (provider!=null && StringUtils.filled(provider.getPractitionerNo())) {
		patientInfo.setProviderNumber(demographic.getProviderNo());
		patientInfo.setCPSONumber(provider.getPractitionerNo());
	}
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:56,代码来源:BORN18MFormToXML.java

示例13: populatePatientInfoFromDemographic

import org.apache.xmlbeans.XmlCalendar; //导入依赖的package包/类
private void populatePatientInfoFromDemographic(PatientInfo patientInfo, Integer demographicNo) {
	//Mandatory fields
	Demographic demographic = demographicDao.getDemographicById(demographicNo);

	patientInfo.setUniqueVendorIDSequence(demographicNo.toString());
	patientInfo.setFirstName(demographic.getFirstName());
	patientInfo.setLastName(demographic.getLastName());
	patientInfo.setDOB(new XmlCalendar(demographic.getBirthDayAsString()));

	if ("M".equals(demographic.getSex())) patientInfo.setGender(Gender.M);
	else if ("F".equals(demographic.getSex())) patientInfo.setGender(Gender.F);
	else patientInfo.setGender(Gender.U);

	patientInfo.setChartNumber(String.valueOf(demographic.getDemographicNo()));
	
	if (StringUtils.filled(demographic.getHin())) patientInfo.setHealthCardNum(demographic.getHin());
	else patientInfo.setHealthCardNum("0");

	patientInfo.setHealthCardType(0);
	if (StringUtils.filled(demographic.getHcType())) {
		if (demographic.getHcType().equals("ON")) patientInfo.setHealthCardType(1);
		if (demographic.getHcType().equals("QC")) patientInfo.setHealthCardType(2);
	}

	//end: Mandatory fields

	if (StringUtils.filled(demographic.getAddress())) patientInfo.setResidentAddressLine1(demographic.getAddress());
	if (StringUtils.filled(demographic.getCity())) patientInfo.setResidentCity(demographic.getCity());
	if (StringUtils.filled(demographic.getProvince())) {
		String province = demographic.getProvince();
		if (province.equals("AB")) patientInfo.setResidentCountryProvince(CountryProvince.CA_AB);
		else if (province.equals("BC")) patientInfo.setResidentCountryProvince(CountryProvince.CA_BC);
		else if (province.equals("MB")) patientInfo.setResidentCountryProvince(CountryProvince.CA_MB);
		else if (province.equals("NB")) patientInfo.setResidentCountryProvince(CountryProvince.CA_NB);
		else if (province.equals("NL")) patientInfo.setResidentCountryProvince(CountryProvince.CA_NL);
		else if (province.equals("NT")) patientInfo.setResidentCountryProvince(CountryProvince.CA_NT);
		else if (province.equals("NS")) patientInfo.setResidentCountryProvince(CountryProvince.CA_NS);
		else if (province.equals("NU")) patientInfo.setResidentCountryProvince(CountryProvince.CA_NU);
		else if (province.equals("ON")) patientInfo.setResidentCountryProvince(CountryProvince.CA_ON);
		else if (province.equals("PE")) patientInfo.setResidentCountryProvince(CountryProvince.CA_PE);
		else if (province.equals("QC")) patientInfo.setResidentCountryProvince(CountryProvince.CA_QC);
		else if (province.equals("SK")) patientInfo.setResidentCountryProvince(CountryProvince.CA_SK);
		else if (province.equals("YT")) patientInfo.setResidentCountryProvince(CountryProvince.CA_YT);
		else if (province.startsWith("US")) patientInfo.setResidentCountryProvince(CountryProvince.USA);
		else patientInfo.setResidentCountryProvince(CountryProvince.UNKN);
	}
	if (StringUtils.filled(demographic.getPostal())) {
		patientInfo.setResidentPostalCode(demographic.getPostal().replace(" ", ""));
	}

	Provider provider = providerDao.getProvider(demographic.getProviderNo());
	if (provider != null && StringUtils.filled(provider.getPractitionerNo())) {
		patientInfo.setProviderNumber(demographic.getProviderNo());
		patientInfo.setCPSONumber(provider.getPractitionerNo());
	}
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:57,代码来源:BORNWbXmlGenerator.java

示例14: populatePatientInfo

import org.apache.xmlbeans.XmlCalendar; //导入依赖的package包/类
private void populatePatientInfo(PatientInfo patientInfo, Integer demographicNo, boolean useClinicInfoForOrganizationId) {

		Demographic demographic = demographicDao.getDemographicById(demographicNo);
		if (demographic == null) {
			logger.warn("cannot find demographic!");
		}

		patientInfo.setUniqueVendorIDSequence(demographicNo.toString());
		patientInfo.setFirstName(demographic.getFirstName());
		patientInfo.setLastName(demographic.getLastName());
		patientInfo.setDOB(new XmlCalendar(demographic.getBirthDayAsString()));

		if ("M".equals(demographic.getSex())) patientInfo.setGender(Gender.M);
		else if ("F".equals(demographic.getSex())) patientInfo.setGender(Gender.F);
		else patientInfo.setGender(Gender.U);

		patientInfo.setChartNumber(String.valueOf(demographic.getDemographicNo()));


		if (StringUtils.filled(demographic.getHin())) patientInfo.setHealthCardNum(demographic.getHin());
		else patientInfo.setHealthCardNum("0");

		patientInfo.setHealthCardType(0);
		if (StringUtils.filled(demographic.getHcType())) {
			if (demographic.getHcType().equals("ON")) patientInfo.setHealthCardType(1);
			if (demographic.getHcType().equals("QC")) patientInfo.setHealthCardType(2);
		}

		if (StringUtils.filled(demographic.getAddress())) patientInfo.setResidentAddressLine1(demographic.getAddress());
		if (StringUtils.filled(demographic.getCity())) patientInfo.setResidentCity(demographic.getCity());
		if (StringUtils.filled(demographic.getProvince())) {
			String province = demographic.getProvince();
			if (province.equals("AB")) patientInfo.setResidentCountryProvince(CountryProvince.CA_AB);
			else if (province.equals("BC")) patientInfo.setResidentCountryProvince(CountryProvince.CA_BC);
			else if (province.equals("MB")) patientInfo.setResidentCountryProvince(CountryProvince.CA_MB);
			else if (province.equals("NB")) patientInfo.setResidentCountryProvince(CountryProvince.CA_NB);
			else if (province.equals("NL")) patientInfo.setResidentCountryProvince(CountryProvince.CA_NL);
			else if (province.equals("NT")) patientInfo.setResidentCountryProvince(CountryProvince.CA_NT);
			else if (province.equals("NS")) patientInfo.setResidentCountryProvince(CountryProvince.CA_NS);
			else if (province.equals("NU")) patientInfo.setResidentCountryProvince(CountryProvince.CA_NU);
			else if (province.equals("ON")) patientInfo.setResidentCountryProvince(CountryProvince.CA_ON);
			else if (province.equals("PE")) patientInfo.setResidentCountryProvince(CountryProvince.CA_PE);
			else if (province.equals("QC")) patientInfo.setResidentCountryProvince(CountryProvince.CA_QC);
			else if (province.equals("SK")) patientInfo.setResidentCountryProvince(CountryProvince.CA_SK);
			else if (province.equals("YT")) patientInfo.setResidentCountryProvince(CountryProvince.CA_YT);
			else if (province.startsWith("US")) patientInfo.setResidentCountryProvince(CountryProvince.USA);
			else patientInfo.setResidentCountryProvince(CountryProvince.UNKN);
		}
		if (StringUtils.filled(demographic.getPostal())) {
			patientInfo.setResidentPostalCode(demographic.getPostal().replace(" ", ""));
		}

		patientInfo.setOrganizationID(OscarProperties.getInstance().getProperty("born_orgcode"));

		if (useClinicInfoForOrganizationId) {
			ClinicInfoDao clinicInfoDao = SpringUtils.getBean(ClinicInfoDao.class);
			ClinicInfoDataObject clinicInfo = clinicInfoDao.getClinic();
			patientInfo.setOrganizationID(clinicInfo.getFacilityName());
		}
	}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:61,代码来源:BORNWbCsdXmlGenerator.java

示例15: propulatePatientInfoFromDemographic

import org.apache.xmlbeans.XmlCalendar; //导入依赖的package包/类
private void propulatePatientInfoFromDemographic(PatientInfo patientInfo) {
	//Mandatory fields
	Demographic demographic = demographicDao.getDemographic(demographicNo);

	patientInfo.setUniqueVendorIDSequence(demographicNo);
	patientInfo.setFirstName(demographic.getFirstName());
	patientInfo.setLastName(demographic.getLastName());
	patientInfo.setDOB(new XmlCalendar(demographic.getBirthDayAsString()));

	if ("M".equals(demographic.getSex())) patientInfo.setGender(Gender.M);
	else if ("F".equals(demographic.getSex())) patientInfo.setGender(Gender.F);
	else patientInfo.setGender(Gender.U);
	
	if (StringUtils.filled(demographic.getChartNo())) patientInfo.setChartNumber(demographic.getChartNo());
	else patientInfo.setChartNumber("0");
	
	if (StringUtils.filled(demographic.getHin())) patientInfo.setHealthCardNum(demographic.getHin());
	else patientInfo.setHealthCardNum("0");
	
	patientInfo.setHealthCardType(0);
	if (StringUtils.filled(demographic.getHcType())) {
		if (demographic.getHcType().equals("ON")) patientInfo.setHealthCardType(1);
		if (demographic.getHcType().equals("QC")) patientInfo.setHealthCardType(2);
	}
	//end: Mandatory fields
	
	if (StringUtils.filled(demographic.getAddress())) patientInfo.setResidentAddressLine1(demographic.getAddress());
	if (StringUtils.filled(demographic.getCity())) patientInfo.setResidentCity(demographic.getCity());
	if (StringUtils.filled(demographic.getProvince())) {
		String province = demographic.getProvince();
		if (province.equals("AB")) patientInfo.setResidentCountryProvince(CountryProvince.CA_AB);
		else if (province.equals("BC")) patientInfo.setResidentCountryProvince(CountryProvince.CA_BC);
		else if (province.equals("MB")) patientInfo.setResidentCountryProvince(CountryProvince.CA_MB);
		else if (province.equals("NB")) patientInfo.setResidentCountryProvince(CountryProvince.CA_NB);
		else if (province.equals("NL")) patientInfo.setResidentCountryProvince(CountryProvince.CA_NL);
		else if (province.equals("NT")) patientInfo.setResidentCountryProvince(CountryProvince.CA_NT);
		else if (province.equals("NS")) patientInfo.setResidentCountryProvince(CountryProvince.CA_NS);
		else if (province.equals("NU")) patientInfo.setResidentCountryProvince(CountryProvince.CA_NU);
		else if (province.equals("ON")) patientInfo.setResidentCountryProvince(CountryProvince.CA_ON);
		else if (province.equals("PE")) patientInfo.setResidentCountryProvince(CountryProvince.CA_PE);
		else if (province.equals("QC")) patientInfo.setResidentCountryProvince(CountryProvince.CA_QC);
		else if (province.equals("SK")) patientInfo.setResidentCountryProvince(CountryProvince.CA_SK);
		else if (province.equals("YT")) patientInfo.setResidentCountryProvince(CountryProvince.CA_YT);
		else if (province.startsWith("US")) patientInfo.setResidentCountryProvince(CountryProvince.USA);
		else patientInfo.setResidentCountryProvince(CountryProvince.UNKN);
	}
	if (StringUtils.filled(demographic.getPostal())) {
		patientInfo.setResidentPostalCode(demographic.getPostal().replace(" ", ""));
	}
	
	Provider provider = null;
	try {
		provider = providerDao.getProvider(demographic.getProviderNo());
	} catch (IllegalArgumentException e) {
		//do nothing, leave provider=null
	}
	if (provider!=null && StringUtils.filled(provider.getPractitionerNo())) {
		patientInfo.setProviderNumber(demographic.getProviderNo());
		patientInfo.setCPSONumber(provider.getPractitionerNo());
	}
}
 
开发者ID:oscarservice,项目名称:oscar-old,代码行数:62,代码来源:BORN18MFormToXML.java


注:本文中的org.apache.xmlbeans.XmlCalendar类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。