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


Java AddressDt类代码示例

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


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

示例1: testPatientRulesInheritanceInModel

import ca.uhn.fhir.model.dstu2.composite.AddressDt; //导入依赖的package包/类
@Test
public void testPatientRulesInheritanceInModel() {
    Assert.assertNotNull(kSession);
    System.out.println(" ---- Starting testPatientRulesInheritanceInModel() Test ---");
    
    kSession.insert(new AsthmaticPatient()
        .setDiagnosedDate(new DateDt(parseDate("2014-06-07")))
        .setBirthDateWithDayPrecision(parseDate("1982-01-01"))
        .setGender(AdministrativeGenderEnum.MALE)
        .addAddress(new AddressDt().setCity("London"))
        .setId("Patient/1")
    );

    Assert.assertEquals(5, kSession.fireAllRules());
    System.out.println(" ---- Finished testPatientRulesInheritanceInModel() Test ---");
}
 
开发者ID:Salaboy,项目名称:drools-workshop,代码行数:17,代码来源:SimpleConditionsRulesJUnitTest.java

示例2: testPatientRulesWithAPatientFromLondonFrom82

import ca.uhn.fhir.model.dstu2.composite.AddressDt; //导入依赖的package包/类
@Test
public void testPatientRulesWithAPatientFromLondonFrom82() {
    Assert.assertNotNull(kSession);
    System.out.println(" ---- Starting testPatientRulesWithAPatientFromLondonFrom82() Test ---");
    kSession.insert(new Patient()
        .setBirthDateWithDayPrecision(parseDate("1982-01-01"))
        .setGender(AdministrativeGenderEnum.MALE)
        .addAddress(new AddressDt().setCity("London"))
        .setId("Patient/1")
    );

    Assert.assertEquals(4, kSession.fireAllRules());
    System.out.println(" ---- Finished testPatientRulesWithAPatientFromLondonFrom82() Test ---");
}
 
开发者ID:Salaboy,项目名称:drools-workshop,代码行数:15,代码来源:SimpleConditionsRulesJUnitTest.java

示例3: testSerialization2

import ca.uhn.fhir.model.dstu2.composite.AddressDt; //导入依赖的package包/类
/**
 * Contributed by Travis from iSalus
 */
@Test
public void testSerialization2() {
	Patient patient = new Patient().addName(new HumanNameDt().addGiven("George").addFamily("Washington")).addName(new HumanNameDt().addGiven("George2").addFamily("Washington2"))
			.addAddress(new AddressDt().addLine("line 1").addLine("line 2").setCity("city").setState("UT"))
			.addAddress(new AddressDt().addLine("line 1b").addLine("line 2b").setCity("cityb").setState("UT")).setBirthDate(new Date(), TemporalPrecisionEnum.DAY);

	testIsSerializable(patient);
}
 
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:12,代码来源:ModelSerializationDstu2Test.java

示例4: addHospitalToBundle

import ca.uhn.fhir.model.dstu2.composite.AddressDt; //导入依赖的package包/类
public static void addHospitalToBundle(Hospital h, Bundle bundle) {
  Organization organizationResource = new Organization();

  organizationResource.addIdentifier().setSystem("https://github.com/synthetichealth/synthea")
      .setValue((String) h.getResourceID());

  Map<String, Object> hospitalAttributes = h.getAttributes();

  organizationResource.setName(hospitalAttributes.get("name").toString());

  AddressDt address = new AddressDt();
  address.addLine(hospitalAttributes.get("address").toString());
  address.setCity(hospitalAttributes.get("city").toString());
  address.setPostalCode(hospitalAttributes.get("city_zip").toString());
  address.setState(hospitalAttributes.get("state").toString());
  organizationResource.addAddress(address);

  Table<Integer, String, AtomicInteger> utilization = h.getUtilization();
  // calculate totals for utilization
  int totalEncounters = utilization.column(Provider.ENCOUNTERS).values().stream()
      .mapToInt(ai -> ai.get()).sum();
  ExtensionDt encountersExtension = new ExtensionDt();
  encountersExtension.setUrl(SYNTHEA_URI + "utilization-encounters-extension");
  IntegerDt encountersValue = new IntegerDt(totalEncounters);
  encountersExtension.setValue(encountersValue);
  organizationResource.addUndeclaredExtension(encountersExtension);

  int totalProcedures = utilization.column(Provider.PROCEDURES).values().stream()
      .mapToInt(ai -> ai.get()).sum();
  ExtensionDt proceduresExtension = new ExtensionDt();
  proceduresExtension.setUrl(SYNTHEA_URI + "utilization-procedures-extension");
  IntegerDt proceduresValue = new IntegerDt(totalProcedures);
  proceduresExtension.setValue(proceduresValue);
  organizationResource.addUndeclaredExtension(proceduresExtension);

  int totalLabs = utilization.column(Provider.LABS).values().stream().mapToInt(ai -> ai.get())
      .sum();
  ExtensionDt labsExtension = new ExtensionDt();
  labsExtension.setUrl(SYNTHEA_URI + "utilization-labs-extension");
  IntegerDt labsValue = new IntegerDt(totalLabs);
  labsExtension.setValue(labsValue);
  organizationResource.addUndeclaredExtension(labsExtension);

  int totalPrescriptions = utilization.column(Provider.PRESCRIPTIONS).values().stream()
      .mapToInt(ai -> ai.get()).sum();
  ExtensionDt prescriptionsExtension = new ExtensionDt();
  prescriptionsExtension.setUrl(SYNTHEA_URI + "utilization-prescriptions-extension");
  IntegerDt prescriptionsValue = new IntegerDt(totalPrescriptions);
  prescriptionsExtension.setValue(prescriptionsValue);
  organizationResource.addUndeclaredExtension(prescriptionsExtension);

  Integer bedCount = h.getBedCount();
  if (bedCount != null) {
    ExtensionDt bedCountExtension = new ExtensionDt();
    bedCountExtension.setUrl(SYNTHEA_URI + "bed-count-extension");
    IntegerDt bedCountValue = new IntegerDt(bedCount);
    bedCountExtension.setValue(bedCountValue);
    organizationResource.addUndeclaredExtension(bedCountExtension);
  }

  newEntry(bundle, organizationResource, h.getResourceID());
}
 
开发者ID:synthetichealth,项目名称:synthea_java,代码行数:63,代码来源:HospitalDSTU2Exporter.java

示例5: sendPatientToFhirServer

import ca.uhn.fhir.model.dstu2.composite.AddressDt; //导入依赖的package包/类
public String sendPatientToFhirServer(EgkPatient patient) {
    FhirContext ctx = FhirContext.forDstu2();
    IGenericClient client = ctx.newRestfulGenericClient(serverBase);

    //set Identifier
    Patient fhirPatient = new Patient();
    fhirPatient.addIdentifier()
            .setSystem("http://fhir.de/NamingSystem/gkv/kvnr")
            .setValue(patient.getHealthInsuranceNumber());
    //setName
    //TODO: HumanName.text adden
    HumanNameDt name = new HumanNameDt();
    name.addFamily(patient.getSurname())
            .addGiven(patient.getGivenName())
            .addPrefix(patient.getTitle())
            .addSuffix(patient.getNamenszusatz());
    ExtensionDt vorsatzwort = new ExtensionDt(false, "http://fhir.de/StructureDefinition/kbv/egk/vorsatzwort", new StringDt(patient.getVorsatzwort()));
    name.addUndeclaredExtension(vorsatzwort);
    fhirPatient.addName(name);

    //setSex
    if (patient.getSex() == Sex.FEMALE)
        fhirPatient.setGender(AdministrativeGenderEnum.FEMALE);
    else if (patient.getSex() == Sex.MALE)
        fhirPatient.setGender(AdministrativeGenderEnum.MALE);
    else
        throw new RuntimeException("Gender of patient was not set");

    //setBirthday
    fhirPatient.setBirthDateWithDayPrecision(Date.from(patient.getBirthday().atStartOfDay(ZoneId.systemDefault()).toInstant()));

    //setAdress
    //TODO: AdressType postal, other Countries than Germany
    List<AddressDt> adresses = new ArrayList<AddressDt>();
    AddressDt adress = new AddressDt();
    adress.addLine(patient.getStreetname() + " " + patient.getHousenumber()).setCity(patient.getCity()).setType(AddressTypeEnum.PHYSICAL).setPostalCode(patient.getZip()).setCountry("Germany");


    ExtensionDt streetname = new ExtensionDt(false, "http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-streetName", new StringDt(patient.getStreetname()));
    ExtensionDt housenumber = new ExtensionDt(false, "http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-houseNumber", new StringDt(patient.getHousenumber()));
    adress.addUndeclaredExtension(streetname);
    adress.addUndeclaredExtension(housenumber);
    adresses.add(adress);
    fhirPatient.setAddress(adresses);

    //setProfile
    fhirPatient.getResourceMetadata().put(ResourceMetadataKeyEnum.PROFILES,
            "http://fhir.de/StructureDefinition/kbv/persoenlicheVersicherungsdaten");

    //submitToServer
    IdDt idPatient = (IdDt) client.update().resource(fhirPatient).conditional()
            .where(Patient.IDENTIFIER.exactly().systemAndIdentifier("http://fhir.de/NamingSystem/gkv/kvnr", patient.getHealthInsuranceNumber()))
            .execute().getId();
    logger.info("EgkPatient with ID: " + idPatient + " generated");


    Organization healthInsurance = new Organization();
    healthInsurance.addIdentifier()
            .setSystem("http://fhir.de/NamingSystem/arge-ik/iknr")
            .setValue(patient.getHealthInsuranceProviderNumber());
    healthInsurance.setName(patient.getHealthInsuranceProviderName());
    IdDt idInsurance = (IdDt) client.update().resource(healthInsurance).conditional()
            .where(Organization.IDENTIFIER.exactly().systemAndIdentifier("http://fhir.de/NamingSystem/arge-ik/iknr",patient.getHealthInsuranceProviderNumber()))
            .execute().getId();
    logger.info("Organization with ID: " + idInsurance + " generated");

    Coverage coverage = new Coverage();
    coverage.addIdentifier()
            .setSystem("http://fhir.de/NamingSystem/gkv/kvnr").setValue(patient.getHealthInsuranceNumber());
    coverage.setIssuer(new ResourceReferenceDt(idInsurance))
            .setSubscriber(new ResourceReferenceDt(idPatient));
    IdDt idCoverage = (IdDt) client.update().resource(coverage).conditional()
            .where(Coverage.IDENTIFIER.exactly().systemAndIdentifier("http://fhir.de/NamingSystem/gkv/kvnr", patient.getHealthInsuranceNumber()))
            .execute().getId();
    logger.info("Coverage with ID: " + idCoverage + " generated");

    return idPatient.toString();
}
 
开发者ID:patrick-werner,项目名称:EGKfeuer,代码行数:79,代码来源:PatientToFhirServiceDSTU2.java


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