當前位置: 首頁>>代碼示例>>Java>>正文


Java AdministrativeGenderCodesEnum類代碼示例

本文整理匯總了Java中ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum的典型用法代碼示例。如果您正苦於以下問題:Java AdministrativeGenderCodesEnum類的具體用法?Java AdministrativeGenderCodesEnum怎麽用?Java AdministrativeGenderCodesEnum使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


AdministrativeGenderCodesEnum類屬於ca.uhn.fhir.model.dstu.valueset包,在下文中一共展示了AdministrativeGenderCodesEnum類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: testGetAllPopulatedChildElementsOfType

import ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum; //導入依賴的package包/類
@Test
public void testGetAllPopulatedChildElementsOfType() {

	Patient p = new Patient();
	p.setGender(AdministrativeGenderCodesEnum.M);
	p.addIdentifier().setSystem("urn:foo");
	p.addAddress().addLine("Line1");
	p.addAddress().addLine("Line2");
	p.addName().addFamily("Line3");

	FhirTerser t = new FhirContext().newTerser();
	List<StringDt> strings = t.getAllPopulatedChildElementsOfType(p, StringDt.class);

	assertEquals(3, strings.size());
	assertThat(strings, containsInAnyOrder(new StringDt("Line1"), new StringDt("Line2"), new StringDt("Line3")));

}
 
開發者ID:gajen0981,項目名稱:FHIR-Server,代碼行數:18,代碼來源:FhirTerserTest.java

示例2: PatientResourceProvider

import ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum; //導入依賴的package包/類
/**
 * Constructor, which pre-populates the provider with one resource instance.
 */
public PatientResourceProvider() {
	long resourceId = myNextId++;
	
	Patient patient = new Patient();
	patient.setId(Long.toString(resourceId));
	patient.addIdentifier();
	patient.getIdentifier().get(0).setSystem(new UriDt("urn:hapitest:mrns"));
	patient.getIdentifier().get(0).setValue("00002");
	patient.addName().addFamily("Test");
	patient.getName().get(0).addGiven("PatientOne");
	patient.setGender(AdministrativeGenderCodesEnum.F);

	LinkedList<Patient> list = new LinkedList<Patient>();
	list.add(patient);
	
	
	myIdToPatientVersions.put(resourceId, list);

}
 
開發者ID:gajen0981,項目名稱:FHIR-Server,代碼行數:23,代碼來源:PatientResourceProvider.java

示例3: main

import ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum; //導入依賴的package包/類
public static void main(String[] theArgs) {

		Patient pat = new Patient();
		pat.addName().addFamily("Simpson").addGiven("Homer").addGiven("J");
		pat.addIdentifier().setSystem("http://acme.org/MRNs").setValue("7000135");
		pat.setGender(AdministrativeGenderCodesEnum.M);
		
		// Create a context
		FhirContext ctx = new FhirContext();
		
		// Create a client
		String serverBaseUrl = "http://fhirtest.uhn.ca/base";
		IGenericClient client = ctx.newRestfulGenericClient(serverBaseUrl);

		// Use the client to store a new resource instance 
		MethodOutcome outcome = client.create().resource(pat).execute();
	
		// Print the ID of the newly created resource
		System.out.println(outcome.getId());
		
	}
 
開發者ID:gajen0981,項目名稱:FHIR-Server,代碼行數:22,代碼來源:Example05_ClientCreate.java

示例4: main

import ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum; //導入依賴的package包/類
public static void main(String[] theArgs) {
	
	// Create a Patient
	Patient pat = new Patient();
	pat.addName().addFamily("Simpson").addGiven("Homer").addGiven("J");
	pat.addIdentifier().setSystem("http://acme.org/MRNs").setValue("7000135");
	pat.addIdentifier().setLabel("Library Card 12345").setValue("12345");
	pat.addTelecom().setUse(ContactUseEnum.HOME).setSystem(ContactSystemEnum.PHONE).setValue("1 (416) 340-4800");
	pat.setGender(AdministrativeGenderCodesEnum.M);
	
	// Create a context
	FhirContext ctx = new FhirContext();
	
	// Create a XML parser
	IParser parser = ctx.newXmlParser();
	parser.setPrettyPrint(true);
	
	String encode = parser.encodeResourceToString(pat);
	System.out.println(encode);
	
}
 
開發者ID:gajen0981,項目名稱:FHIR-Server,代碼行數:22,代碼來源:Example03_EncodeResource.java

示例5: main

import ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum; //導入依賴的package包/類
public static void main(String[] theArgs) {

		// Create a client
		String serverBaseUrl = "http://fhirtest.uhn.ca/base";
		FhirContext ctx = new FhirContext();
		IGenericClient client = ctx.newRestfulGenericClient(serverBaseUrl);

		// Use the client to read back the new instance using the
		// ID we retrieved from the read
		Patient patient = client.read(Patient.class, "4529");
	
		// Print the ID of the newly created resource
		System.out.println("Found ID:    " + patient.getId());
		
		// Change the gender and send an update to the server
		patient.setGender(AdministrativeGenderCodesEnum.F);
		MethodOutcome outcome = client.update().resource(patient).execute();
		
		System.out.println("Now have ID: " + outcome.getId());
		
	}
 
開發者ID:gajen0981,項目名稱:FHIR-Server,代碼行數:22,代碼來源:Example07_ClientSearch.java

示例6: main

import ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum; //導入依賴的package包/類
public static void main(String[] theArgs) {
	
	Patient pat = new Patient();
	
	pat.addName().addFamily("Simpson").addGiven("Homer").addGiven("J");
	pat.addIdentifier().setSystem("http://acme.org/MRNs").setValue("7000135");
	pat.addIdentifier().setLabel("Library Card 12345").setValue("12345");

	// Enumerated types are provided for many coded elements
	ContactDt contact = pat.addTelecom();
	contact.setUse(ContactUseEnum.HOME);
	contact.setSystem(ContactSystemEnum.PHONE);
	contact.setValue("1 (416) 340-4800");
	
	pat.setGender(AdministrativeGenderCodesEnum.M);
	
}
 
開發者ID:gajen0981,項目名稱:FHIR-Server,代碼行數:18,代碼來源:Example02_CreateAPatient.java

示例7: initPatient

import ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum; //導入依賴的package包/類
private void initPatient() {
	this.patient = new Patient();
	this.patient.setId(new IdDt(UUID.randomUUID().toString()));
	this.patient.addIdentifier().setSystem("http://example.com/fictitious-mrns").setValue("MRN001");
	this.patient.setGender(AdministrativeGenderCodesEnum.M);
	this.patient.addName().setUse(NameUseEnum.OFFICIAL).addFamily(this.patFamName1).addGiven(this.patGivName1);

}
 
開發者ID:gajen0981,項目名稱:FHIR-Server,代碼行數:9,代碼來源:ContainedResourceEncodingTest.java

示例8: testSubmitPatient

import ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum; //導入依賴的package包/類
@Test
public void testSubmitPatient() {
	Patient p = new Patient();
	p.addIdentifier("urn:MultiFhirVersionTest", "testSubmitPatient01");
	p.addUndeclaredExtension(false, "http://foo#ext1", new StringDt("The value"));
	p.getGender().setValueAsEnum(AdministrativeGenderCodesEnum.M);
	IdDt id = ourClientDstu1.create().resource(p).execute().getId();

	// Read back as DSTU1
	Patient patDstu1 = ourClientDstu1.read(Patient.class, id);
	assertEquals("testSubmitPatient01", p.getIdentifierFirstRep().getValue().getValue());
	assertEquals(1, patDstu1.getUndeclaredExtensionsByUrl("http://foo#ext1").size());
	assertEquals("M", patDstu1.getGender().getCodingFirstRep().getCode().getValue());

	// Read back as DEV
	ca.uhn.fhir.model.dstu2.resource.Patient patDstu2;
	patDstu2 = ourClientDstu2.read(ca.uhn.fhir.model.dstu2.resource.Patient.class, id);
	assertEquals("testSubmitPatient01", p.getIdentifierFirstRep().getValue().getValue());
	assertEquals(1, patDstu2.getUndeclaredExtensionsByUrl("http://foo#ext1").size());
	assertEquals(null, patDstu2.getGender());

	// Search using new bundle format
	Bundle bundle = ourClientDstu2.search().forResource(ca.uhn.fhir.model.dstu2.resource.Patient.class).where(Patient.IDENTIFIER.exactly().systemAndCode("urn:MultiFhirVersionTest", "testSubmitPatient01")).encodedJson().execute();
	patDstu2 = (ca.uhn.fhir.model.dstu2.resource.Patient) bundle.getEntries().get(0).getResource();
	assertEquals("testSubmitPatient01", p.getIdentifierFirstRep().getValue().getValue());
	assertEquals(1, patDstu2.getUndeclaredExtensionsByUrl("http://foo#ext1").size());
	assertEquals(null, patDstu2.getGender());

}
 
開發者ID:gajen0981,項目名稱:FHIR-Server,代碼行數:30,代碼來源:ResourceProviderMultiVersionTest.java

示例9: getResourceById

import ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum; //導入依賴的package包/類
/**
    * The "@Read" annotation indicates that this method supports the
    * read operation. Read operations should return a single resource
    * instance.
    *
    * @param theId
    *    The read operation takes one parameter, which must be of type
    *    IdDt and must be annotated with the "@Read.IdParam" annotation.
    * @return
    *    Returns a resource matching this identifier, or null if none exists.
    */
    @Read()
    public Patient getResourceById(@IdParam IdDt theId) throws Exception {
      String patientId = theId.getIdPart();

      byte[] res = rpcClient.call("GetPatient", "{\"method\": \"GetPatient\", \"params\": {\"id\": " + patientId + "}}");

      ObjectMapper mapper = new ObjectMapper();
      mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
      FiviumPatient fiviumPatient = mapper.readValue(res, FiviumPatient.class);

      res = rpcClient.call("GetEhrId", "{\"method\": \"GetEhrId\", \"params\": {\"MRN\": \"" + fiviumPatient.getMrn() + "\"}}");
      RPCResultGetEhrId getEhrResult = mapper.readValue(res, RPCResultGetEhrId.class);

      Patient patient = new Patient();
      patient.addIdentifier();
      patient.getIdentifier().get(0).setSystem(new UriDt("id"));
      patient.getIdentifier().get(0).setValue(fiviumPatient.getId());
      patient.addIdentifier();
      patient.getIdentifier().get(1).setSystem(new UriDt("mrn"));
      patient.getIdentifier().get(1).setValue(fiviumPatient.getMrn());
      patient.addIdentifier();
      patient.getIdentifier().get(2).setSystem(new UriDt("ehrId"));
      patient.getIdentifier().get(2).setValue(getEhrResult.getEhrId());
      Calendar dobCal = DatatypeConverter.parseDate(fiviumPatient.getDob());
      patient.setBirthDate(dobCal.getTime(), TemporalPrecisionEnum.DAY);
      patient.addName();
      patient.getName().get(0).addGiven(fiviumPatient.getFirstname());
      patient.getName().get(0).addFamily(fiviumPatient.getSurname());
      patient.addContact();
      patient.getContact().get(0).addTelecom();
      patient.getContact().get(0).getTelecom().get(0).setSystem(ContactSystemEnum.PHONE);
      patient.getContact().get(0).getTelecom().get(0).setValue(fiviumPatient.getPhone());
      patient.addContact();
      patient.getContact().get(1).addTelecom();
      patient.getContact().get(1).getTelecom().get(0).setSystem(ContactSystemEnum.EMAIL);
      patient.getContact().get(1).getTelecom().get(0).setValue(fiviumPatient.getEmail());

      if (fiviumPatient.getGender().equals("FEMALE")) {
        patient.setGender(AdministrativeGenderCodesEnum.F);
      } else if (fiviumPatient.getGender().equals("MALE")) {
        patient.setGender(AdministrativeGenderCodesEnum.M);
      } else {
        patient.setGender(AdministrativeGenderCodesEnum.UNK);
      }

//      private String tumorType;
//      private String surgical;

      return patient;
    }
 
開發者ID:FiviumAustralia,項目名稱:RNSH-Pilot-FHIR-Service,代碼行數:62,代碼來源:RestfulPatientResourceProvider.java

示例10: testEncodeBoundCode

import ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum; //導入依賴的package包/類
@Test
public void testEncodeBoundCode() {

	Patient patient = new Patient();
	patient.addAddress().setUse(AddressUseEnum.HOME);

	patient.getGender().setValueAsEnum(AdministrativeGenderCodesEnum.M);

	String val = ourCtx.newXmlParser().encodeResourceToString(patient);
	ourLog.info(val);

}
 
開發者ID:gajen0981,項目名稱:FHIR-Server,代碼行數:13,代碼來源:XmlParserTest.java


注:本文中的ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。