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


Java CodeableConceptDt类代码示例

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


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

示例1: mapCodeToCodeableConcept

import ca.uhn.fhir.model.dstu2.composite.CodeableConceptDt; //导入依赖的package包/类
/**
 * Helper function to convert a Code into a CodeableConceptDt. Takes an optional system, which
 * replaces the Code.system in the resulting CodeableConceptDt if not null.
 * 
 * @param from
 *          The Code to create a CodeableConcept from.
 * @param system
 *          The system identifier, such as a URI. Optional; may be null.
 * @return The converted CodeableConcept
 */
private static CodeableConceptDt mapCodeToCodeableConcept(Code from, String system) {
  CodeableConceptDt to = new CodeableConceptDt();

  if (from.display != null) {
    to.setText(from.display);
  }

  CodingDt coding = new CodingDt();
  coding.setCode(from.code);
  coding.setDisplay(from.display);
  if (system == null) {
    coding.setSystem(from.system);
  } else {
    coding.setSystem(system);
  }

  to.addCoding(coding);

  return to;
}
 
开发者ID:synthetichealth,项目名称:synthea_java,代码行数:31,代码来源:FhirDstu2.java

示例2: nonNull

import ca.uhn.fhir.model.dstu2.composite.CodeableConceptDt; //导入依赖的package包/类
@SuppressWarnings("unused")
public void nonNull() {
   // START SNIPPET: nonNull
   Observation observation = new Observation();

   // None of these calls will not return null, but instead create their
   // respective
   // child elements.
   List<IdentifierDt> identifierList = observation.getIdentifier();
   CodeableConceptDt code = observation.getCode();
   StringDt textElement = observation.getCode().getTextElement();

   // DateTimeDt is a FHIR primitive however, so the following will return
   // null
   // unless a value has been placed there.
   Date active = observation.addIdentifier().getPeriod().getStartElement().getValue();
   // END SNIPPET: nonNull

}
 
开发者ID:gajen0981,项目名称:FHIR-Server,代码行数:20,代码来源:FhirDataModel.java

示例3: sendObservation

import ca.uhn.fhir.model.dstu2.composite.CodeableConceptDt; //导入依赖的package包/类
private Observation sendObservation(String code, String system) throws InterruptedException {
	Observation observation = new Observation();
	CodeableConceptDt codeableConcept = new CodeableConceptDt();
	observation.setCode(codeableConcept);
	CodingDt coding = codeableConcept.addCoding();
	coding.setCode(code);
	coding.setSystem(system);

	observation.setStatus(ObservationStatusEnum.FINAL);

	MethodOutcome methodOutcome = ourClient.create().resource(observation).execute();

	String observationId = methodOutcome.getId().getIdPart();
	observation.setId(observationId);

	waitForQueueToDrain();
	return observation;
}
 
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:19,代码来源:RestHookTestWithInterceptorRegisteredToDaoConfigDstu2Test.java

示例4: createObservation

import ca.uhn.fhir.model.dstu2.composite.CodeableConceptDt; //导入依赖的package包/类
@Test
public void createObservation() throws Exception {
	Observation observation = new Observation();
	CodeableConceptDt cc = new CodeableConceptDt();
	observation.setCode(cc);
	CodingDt coding = cc.addCoding();
	coding.setCode("82313006");
	coding.setSystem("SNOMED-CT");
	ResourceReferenceDt reference = new ResourceReferenceDt();
	reference.setReference("Patient/" + myPatientId);
	observation.setSubject(reference);
	observation.setStatus(ObservationStatusEnum.FINAL);

	MethodOutcome methodOutcome2 = ourClient.create().resource(observation).execute();
	String observationId = methodOutcome2.getId().getIdPart();
	observation.setId(observationId);

	ourLog.info("Observation id generated by server is: " + observationId);

	ourLog.info("WS Messages: {}", mySocketImplementation.getMessages());
	waitForSize(2, mySocketImplementation.getMessages());
	assertThat(mySocketImplementation.getMessages(), contains("bound " + mySubscriptionId, "ping " + mySubscriptionId));
}
 
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:24,代码来源:WebsocketWithCriteriaDstu2Test.java

示例5: createObservationThatDoesNotMatch

import ca.uhn.fhir.model.dstu2.composite.CodeableConceptDt; //导入依赖的package包/类
@Test
public void createObservationThatDoesNotMatch() throws Exception {
	Observation observation = new Observation();
	CodeableConceptDt cc = new CodeableConceptDt();
	observation.setCode(cc);
	CodingDt coding = cc.addCoding();
	coding.setCode("8231");
	coding.setSystem("SNOMED-CT");
	ResourceReferenceDt reference = new ResourceReferenceDt();
	reference.setReference("Patient/" + myPatientId);
	observation.setSubject(reference);
	observation.setStatus(ObservationStatusEnum.FINAL);

	MethodOutcome methodOutcome2 = ourClient.create().resource(observation).execute();
	String observationId = methodOutcome2.getId().getIdPart();
	observation.setId(observationId);

	ourLog.info("Observation id generated by server is: " + observationId);

	waitForSize(2, mySocketImplementation.getMessages());
	ourLog.info("WS Messages: {}", mySocketImplementation.getMessages());
	assertThat(mySocketImplementation.getMessages(), contains("bound " + mySubscriptionId));
}
 
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:24,代码来源:WebsocketWithCriteriaDstu2Test.java

示例6: sendObservation

import ca.uhn.fhir.model.dstu2.composite.CodeableConceptDt; //导入依赖的package包/类
private Observation sendObservation(String code, String system) {
	Observation observation = new Observation();
	CodeableConceptDt codeableConcept = new CodeableConceptDt();
	observation.setCode(codeableConcept);
	CodingDt coding = codeableConcept.addCoding();
	coding.setCode(code);
	coding.setSystem(system);

	observation.setStatus(ObservationStatusEnum.FINAL);

	MethodOutcome methodOutcome = ourClient.create().resource(observation).execute();

	String observationId = methodOutcome.getId().getIdPart();
	observation.setId(observationId);

	return observation;
}
 
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:18,代码来源:EmailSubscriptionDstu2Test.java

示例7: createObservationThatDoesNotMatch

import ca.uhn.fhir.model.dstu2.composite.CodeableConceptDt; //导入依赖的package包/类
@Test
public void createObservationThatDoesNotMatch() throws Exception {
	Observation observation = new Observation();
	CodeableConceptDt cc = new CodeableConceptDt();
	observation.setCode(cc);
	CodingDt coding = cc.addCoding();
	coding.setCode("8231");
	coding.setSystem("SNOMED-CT");
	ResourceReferenceDt reference = new ResourceReferenceDt();
	reference.setReference("Patient/" + myPatientId);
	observation.setSubject(reference);
	observation.setStatus(ObservationStatusEnum.FINAL);

	MethodOutcome methodOutcome2 = ourClient.create().resource(observation).execute();
	String observationId = methodOutcome2.getId().getIdPart();
	observation.setId(observationId);

	ourLog.info("Observation id generated by server is: " + observationId);

	ourLog.info("WS Messages: {}", mySocketImplementation.getMessages());
	waitForSize(1, mySocketImplementation.getMessages());
	assertThat(mySocketImplementation.getMessages(), contains("bound " + mySubscriptionId));
}
 
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:24,代码来源:WebsocketWithSubscriptionIdDstu2Test.java

示例8: testCD2CodeableConcept

import ca.uhn.fhir.model.dstu2.composite.CodeableConceptDt; //导入依赖的package包/类
@Test
public void testCD2CodeableConcept() {
	// simple instance test
    CD cd = DatatypesFactory.eINSTANCE.createCD();
    
    cd.setCode("code");
    cd.setCodeSystem("codeSystem");
    cd.setCodeSystemVersion("codeSystemVersion");
    cd.setDisplayName("displayName");
  
    CodeableConceptDt codeableConcept = dtt.tCD2CodeableConcept(cd);
    
    Assert.assertEquals("CD.code transformation failed", "code", codeableConcept.getCoding().get(0).getCode());
    Assert.assertEquals("CD.codeSystem transformation failed", "urn:oid:codeSystem", codeableConcept.getCoding().get(0).getSystem());
    Assert.assertEquals("CD.codeSystemVersion transformation failed", "codeSystemVersion", codeableConcept.getCoding().get(0).getVersion());
    Assert.assertEquals("CD.displayName transformation failed", "displayName", codeableConcept.getCoding().get(0).getDisplay());
    
    // null instance test
    CD cd2 = null;
    CodeableConceptDt codeableConcept2 = dtt.tCD2CodeableConcept( cd2 );
    Assert.assertNull("CD null instance transform failed", codeableConcept2);
    
    // nullFlavor instance test
    CD cd3 = DatatypesFactory.eINSTANCE.createCD();
    cd3.setNullFlavor(NullFlavor.NI);
    CodeableConceptDt codeableConcept3 = dtt.tCD2CodeableConcept( cd3 );
    Assert.assertNull("CodeableConcept.nullFlavor set instance transform failed", codeableConcept3);
}
 
开发者ID:srdc,项目名称:cda2fhir,代码行数:29,代码来源:DataTypesTransformerTest.java

示例9: resolveReturnType

import ca.uhn.fhir.model.dstu2.composite.CodeableConceptDt; //导入依赖的package包/类
protected Class resolveReturnType(Class clazz, Object target, String path) {
    if (target instanceof PeriodDt) {
        if (path.equals("start") || path.equals("end")) {
            return DateTimeDt.class;
        }
    }
    else if (target instanceof QuantityDt) {
        if (path.equals("value")) {
            return DecimalDt.class;
        }
        else if (path.equals("unit")) {
            return StringDt.class;
        }
    }
    else if (target instanceof CodingDt) {
        if (path.equals("code")) {
            return CodeDt.class;
        }
        else if (path.equals("system")) {
            return UriDt.class;
        }
        else if (path.equals("version") || path.equals("display")) {
            return StringDt.class;
        }
    }
    else if (target instanceof CodeableConceptDt) {
        if (path.equals("text")) {
            return StringDt.class;
        }
    }
    return clazz;
}
 
开发者ID:DBCG,项目名称:cql_engine,代码行数:33,代码来源:FhirDataProviderDstu2.java

示例10: resolveMedicationRequest

import ca.uhn.fhir.model.dstu2.composite.CodeableConceptDt; //导入依赖的package包/类
public static MedicationRequest resolveMedicationRequest(MedicationOrder order) throws FHIRException {
    /*
    *   Required fields:
    *   MedicationOrder -> MedicationRequest
    *   medication -> medication
    *   dosageInstruction (Backbone) -> Dosage (Element)
    */
    return new MedicationRequest()
            .setStatus(MedicationRequest.MedicationRequestStatus.fromCode(order.getStatus()))
            .setMedication(convertToCodeableConcept((CodeableConceptDt) order.getMedication()))
            .setDosageInstruction(convertToDosage(order.getDosageInstruction()));
}
 
开发者ID:DBCG,项目名称:cqf-ruler,代码行数:13,代码来源:Dstu2ToStu3.java

示例11: convertToCodeableConcept

import ca.uhn.fhir.model.dstu2.composite.CodeableConceptDt; //导入依赖的package包/类
private static CodeableConcept convertToCodeableConcept(CodeableConceptDt conceptDt) {
    CodeableConcept concept = new CodeableConcept().setText(conceptDt.getText() == null ? "" : conceptDt.getText());
    concept.setId(conceptDt.getElementSpecificId());
    List<Coding> codes = new ArrayList<>();
    for (CodingDt code : conceptDt.getCoding()) {
        codes.add(new Coding()
                .setCode(code.getCode())
                .setSystem(code.getSystem())
                .setDisplay(code.getDisplay())
                .setVersion(code.getVersion())
        );
    }
    return concept.setCoding(codes);
}
 
开发者ID:DBCG,项目名称:cqf-ruler,代码行数:15,代码来源:Dstu2ToStu3.java

示例12: testUpdateLoop

import ca.uhn.fhir.model.dstu2.composite.CodeableConceptDt; //导入依赖的package包/类
@Test
public void testUpdateLoop() {
    Assert.assertNotNull(kSession);
    System.out.println(" ---- Starting testUpdateLoop() Test ---");

    Patient patient = (Patient) new Patient().setId("Patient/1");
    
    RiskAssessment riskAssessment = (RiskAssessment) new RiskAssessment().setId("RiskAssessment/1");
    
    Observation smokerObservation = (Observation) new Observation()
        .setCode(new CodeableConceptDt("http://snomed.info/sct", "428041000124106"))
        .setId("Observation/1");
    
    Observation bodyMassIndexObservation = (Observation) new Observation()
        .setCode(new CodeableConceptDt("http://snomed.info/sct", "60621009"))
        .setValue(new IntegerDt(45))
        .setId("Observation/2");

    kSession.insert(patient);
    kSession.insert(riskAssessment);
    kSession.insert(smokerObservation);
    kSession.insert(bodyMassIndexObservation);
    
    Assert.assertEquals(15, kSession.fireAllRules(15));
    System.out.println(" ---- Finished testUpdateLoop() Test ---");
    
}
 
开发者ID:Salaboy,项目名称:drools-workshop,代码行数:28,代码来源:InfiniteLoopJUnitTest.java

示例13: createSnomedConditions

import ca.uhn.fhir.model.dstu2.composite.CodeableConceptDt; //导入依赖的package包/类
private List<Condition> createSnomedConditions(int number, Patient patient) {

        List<Condition> conditions = new ArrayList<>();
        for (int i = 0; i < number; i++) {

            String code = null;
            switch (random.nextInt(3)) {
                case 0:
                    code = "195967001"; //Asthma (disorder)
                    break;
                case 1:
                    code = "73211009"; //Diabetes mellitus (disorder)
                    break;
                case 2:
                    code = "8098009"; //Sexually transmitted infectious disease (disorder)
                    break;
            }

            conditions.add((Condition) new Condition()
                .setCode(new CodeableConceptDt("http://snomed.info/sct", code))
                .setClinicalStatus(ConditionClinicalStatusCodesEnum.ACTIVE)
                .setVerificationStatus(ConditionVerificationStatusEnum.CONFIRMED)
                .setPatient(new ResourceReferenceDt(patient))
                .setId("Condition/"+(i+1)));
        }

        return conditions;
    }
 
开发者ID:Salaboy,项目名称:drools-workshop,代码行数:29,代码来源:QueryRulesJUnitTest.java

示例14: createAsthmaCondition

import ca.uhn.fhir.model.dstu2.composite.CodeableConceptDt; //导入依赖的package包/类
private Condition createAsthmaCondition(Patient patient, String id, Severity severity ){
    return (Condition) new Condition()
        .setCode(new CodeableConceptDt("http://snomed.info/sct", "195967001"))
        .setClinicalStatus(ConditionClinicalStatusCodesEnum.ACTIVE)
        .setVerificationStatus(ConditionVerificationStatusEnum.CONFIRMED)
        .setSeverity(new CodeableConceptDt("http://snomed.info/sct", severity.code))
        .setPatient(new ResourceReferenceDt(patient))
        .setId(id);
}
 
开发者ID:Salaboy,项目名称:drools-workshop,代码行数:10,代码来源:SimpleInferenceRulesJUnitTest.java

示例15: generateBloodPressureObservations

import ca.uhn.fhir.model.dstu2.composite.CodeableConceptDt; //导入依赖的package包/类
private List<Observation> generateBloodPressureObservations(int amount) {
    List<Observation> results = new ArrayList<>();
    for (int i = 0; i < amount; i++) {
        results.add((Observation) new Observation()
            .setCode(new CodeableConceptDt("http://loinc.org", "55284-4")) //Diastolic
            .setValue(new IntegerDt(random.nextInt(40)+60))
            .setId("Observation/"+(i+1)));
    }
    return results;
}
 
开发者ID:Salaboy,项目名称:drools-workshop,代码行数:11,代码来源:AccumulationRulesJUnitTest.java


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