本文整理汇总了Java中org.hl7.fhir.dstu3.model.Coding类的典型用法代码示例。如果您正苦于以下问题:Java Coding类的具体用法?Java Coding怎么用?Java Coding使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Coding类属于org.hl7.fhir.dstu3.model包,在下文中一共展示了Coding类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: mapCodeToCodeableConcept
import org.hl7.fhir.dstu3.model.Coding; //导入依赖的package包/类
/**
* Helper function to convert a Code into a CodeableConcept. Takes an optional system, which
* replaces the Code.system in the resulting CodeableConcept 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 CodeableConcept mapCodeToCodeableConcept(Code from, String system) {
CodeableConcept to = new CodeableConcept();
if (from.display != null) {
to.setText(from.display);
}
Coding coding = new Coding();
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,代码来源:FhirStu3.java
示例2: coding
import org.hl7.fhir.dstu3.model.Coding; //导入依赖的package包/类
@Test
public void coding() {
Coding expectedCoding = condition.getSeverity().getCodingFirstRep();
Coding actualCoding = decodedCondition.getSeverity().getCodingFirstRep();
// Codings are a nested array, so we explode them into a table of the coding
// fields so we can easily select and compare individual fields.
Dataset<Row> severityCodings = conditionsDataset
.select(functions.explode(conditionsDataset.col("severity.coding"))
.alias("coding"))
.select("coding.*") // Pull all fields in the coding to the top level.
.cache();
Assert.assertEquals(expectedCoding.getCode(),
severityCodings.select("code").head().get(0));
Assert.assertEquals(expectedCoding.getCode(),
actualCoding.getCode());
Assert.assertEquals(expectedCoding.getSystem(),
severityCodings.select("system").head().get(0));
Assert.assertEquals(expectedCoding.getSystem(),
actualCoding.getSystem());
Assert.assertEquals(expectedCoding.getUserSelected(),
severityCodings.select("userSelected").head().get(0));
Assert.assertEquals(expectedCoding.getUserSelected(),
actualCoding.getUserSelected());
Assert.assertEquals(expectedCoding.getDisplay(),
severityCodings.select("display").head().get(0));
Assert.assertEquals(expectedCoding.getDisplay(),
actualCoding.getDisplay());
}
开发者ID:cerner,项目名称:bunsen,代码行数:35,代码来源:FhirEncodersTest.java
示例3: findAddCode
import org.hl7.fhir.dstu3.model.Coding; //导入依赖的package包/类
@Override
public ConceptEntity findAddCode(Quantity quantity) {
Coding code = new Coding().setCode(quantity.getCode()).setSystem(quantity.getSystem());
ConceptEntity conceptEntity = findCode(code);
// 12/Jan/2018 KGM to cope with LOINC codes and depreciated SNOMED codes.
if (conceptEntity == null) {
CodeSystemEntity system = codeSystemRepository.findBySystem(quantity.getSystem());
if (system !=null) {
conceptEntity = new ConceptEntity();
conceptEntity.setCode(quantity.getCode());
conceptEntity.setDescription(quantity.getUnit());
conceptEntity.setDisplay(quantity.getUnit());
conceptEntity.setCodeSystem(system);
em.persist(conceptEntity);
} else {
throw new IllegalArgumentException("Unsupported system "+quantity.getSystem());
}
}
return conceptEntity;
}
开发者ID:nhsconnect,项目名称:careconnect-reference-implementation,代码行数:22,代码来源:ConceptDao.java
示例4: describeTransformCCorC
import org.hl7.fhir.dstu3.model.Coding; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
private String describeTransformCCorC(StructureMapGroupRuleTargetComponent tgt) throws FHIRException {
if (tgt.getParameter().size() < 2)
return null;
Type p1 = tgt.getParameter().get(0).getValue();
Type p2 = tgt.getParameter().get(1).getValue();
if (p1 instanceof IdType || p2 instanceof IdType)
return null;
if (!(p1 instanceof PrimitiveType) || !(p2 instanceof PrimitiveType))
return null;
String uri = ((PrimitiveType) p1).asStringValue();
String code = ((PrimitiveType) p2).asStringValue();
if (Utilities.noString(uri))
throw new FHIRException("Describe Transform, but the uri is blank");
if (Utilities.noString(code))
throw new FHIRException("Describe Transform, but the code is blank");
Coding c = buildCoding(uri, code);
return NarrativeGenerator.describeSystem(c.getSystem())+"#"+c.getCode()+(c.hasDisplay() ? "("+c.getDisplay()+")" : "");
}
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:20,代码来源:StructureMapUtilities.java
示例5: makeCodingFromCV
import org.hl7.fhir.dstu3.model.Coding; //导入依赖的package包/类
public Coding makeCodingFromCV(Element cd) throws Exception {
if (cd == null || Utilities.noString(cd.getAttribute("code")))
return null;
Coding c = new Coding();
c.setCode(cd.getAttribute("code"));
c.setDisplay(cd.getAttribute("displayName"));
String r = cd.getAttribute("codeSystem");
String uri = getUriForOID(r);
if (uri != null)
c.setSystem(uri);
else if (isGuid(r))
c.setSystem("urn:uuid:"+r);
else if (UriForOid(r) != null)
c.setSystem(UriForOid(r));
else
c.setSystem("urn:oid:"+r);
return c;
}
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:19,代码来源:Convert.java
示例6: run
import org.hl7.fhir.dstu3.model.Coding; //导入依赖的package包/类
@Override
public void run() {
for (int i = 0; i < 50; i++) {
try {
Patient p = new Patient();
p.addIdentifier().setSystem("http://test").setValue("BAR").setType(new CodeableConcept().addCoding(new Coding().setSystem("http://foo").setCode("bar")));
p.setGender(org.hl7.fhir.dstu3.model.Enumerations.AdministrativeGender.MALE);
ourClient.create().resource(p).execute();
ourSearchParamRegistry.forceRefresh();
} catch (Throwable e) {
ourLog.error("Failure during search", e);
myError = e;
return;
}
}
}
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:19,代码来源:StressTestDstu3Test.java
示例7: testLookupOperationByCoding
import org.hl7.fhir.dstu3.model.Coding; //导入依赖的package包/类
@Test
public void testLookupOperationByCoding() {
//@formatter:off
Parameters respParam = ourClient
.operation()
.onType(CodeSystem.class)
.named("lookup")
.withParameter(Parameters.class, "coding", new Coding().setSystem("http://acme.org").setCode("8450-9"))
.execute();
//@formatter:on
String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
ourLog.info(resp);
assertEquals("name", respParam.getParameter().get(0).getName());
assertEquals(("Unknown"), ((StringType)respParam.getParameter().get(0).getValue()).getValue());
assertEquals("display", respParam.getParameter().get(1).getName());
assertEquals(("Systolic blood pressure--expiration"), ((StringType)respParam.getParameter().get(1).getValue()).getValue());
assertEquals("abstract", respParam.getParameter().get(2).getName());
assertEquals(false, ((BooleanType)respParam.getParameter().get(2).getValue()).getValue().booleanValue());
}
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:22,代码来源:ResourceProviderDstu3CodeSystemTest.java
示例8: testLookupOperationByInvalidCombination
import org.hl7.fhir.dstu3.model.Coding; //导入依赖的package包/类
@Test
public void testLookupOperationByInvalidCombination() {
//@formatter:off
try {
ourClient
.operation()
.onType(CodeSystem.class)
.named("lookup")
.withParameter(Parameters.class, "coding", new Coding().setSystem("http://acme.org").setCode("8450-9"))
.andParameter("code", new CodeType("8450-9"))
.andParameter("system", new UriType("http://acme.org"))
.execute();
fail();
} catch (InvalidRequestException e) {
assertEquals("HTTP 400 Bad Request: $lookup can only validate (system AND code) OR (coding.system AND coding.code)", e.getMessage());
}
//@formatter:on
}
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:19,代码来源:ResourceProviderDstu3CodeSystemTest.java
示例9: testLookupOperationByInvalidCombination2
import org.hl7.fhir.dstu3.model.Coding; //导入依赖的package包/类
@Test
public void testLookupOperationByInvalidCombination2() {
//@formatter:off
try {
ourClient
.operation()
.onType(CodeSystem.class)
.named("lookup")
.withParameter(Parameters.class, "coding", new Coding().setSystem("http://acme.org").setCode("8450-9"))
.andParameter("system", new UriType("http://acme.org"))
.execute();
fail();
} catch (InvalidRequestException e) {
assertEquals("HTTP 400 Bad Request: $lookup can only validate (system AND code) OR (coding.system AND coding.code)", e.getMessage());
}
//@formatter:on
}
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:18,代码来源:ResourceProviderDstu3CodeSystemTest.java
示例10: testLookupOperationByInvalidCombination3
import org.hl7.fhir.dstu3.model.Coding; //导入依赖的package包/类
@Test
public void testLookupOperationByInvalidCombination3() {
//@formatter:off
try {
ourClient
.operation()
.onType(CodeSystem.class)
.named("lookup")
.withParameter(Parameters.class, "coding", new Coding().setSystem("http://acme.org").setCode(null))
.execute();
fail();
} catch (InvalidRequestException e) {
assertEquals("HTTP 400 Bad Request: No code, coding, or codeableConcept provided to validate", e.getMessage());
}
//@formatter:on
}
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:17,代码来源:ResourceProviderDstu3CodeSystemTest.java
示例11: getCategory
import org.hl7.fhir.dstu3.model.Coding; //导入依赖的package包/类
public ConditionCategory getCategory(DomainResource resource){
org.hl7.fhir.dstu3.model.Condition fhirCondition =
(org.hl7.fhir.dstu3.model.Condition) resource;
if (!fhirCondition.getCategory().isEmpty()) {
List<Coding> coding = fhirCondition.getCategory().get(0).getCoding();
if (!coding.isEmpty()) {
for (Coding categoryCoding : coding) {
if (categoryCoding.getSystem()
.equals("http://hl7.org/fhir/condition-category")) {
return (ConditionCategory) categoryMapping
.getLocalEnumValueByCode(categoryCoding.getCode().toUpperCase());
}
}
}
}
return ConditionCategory.UNKNOWN;
}
开发者ID:elexis,项目名称:elexis-3-core,代码行数:18,代码来源:ConditionAccessor.java
示例12: setCategory
import org.hl7.fhir.dstu3.model.Coding; //导入依赖的package包/类
public void setCategory(DomainResource resource, ObservationCategory category){
org.hl7.fhir.dstu3.model.Observation fhirObservation =
(org.hl7.fhir.dstu3.model.Observation) resource;
CodeableConcept categoryCode = new CodeableConcept();
if (category.name().startsWith("SOAP_")) {
// elexis soap categories
categoryCode.setCoding(
Collections.singletonList(new Coding(IdentifierSystem.ELEXIS_SOAP.getSystem(),
category.getCode(), category.getLocalized())));
} else {
org.hl7.fhir.dstu3.model.codesystems.ObservationCategory fhirCategoryCode =
(org.hl7.fhir.dstu3.model.codesystems.ObservationCategory) categoryMapping
.getFhirEnumValueByEnum(category);
if (fhirCategoryCode != null) {
// lookup matching fhir category
categoryCode
.setCoding(Collections.singletonList(new Coding(fhirCategoryCode.getSystem(),
fhirCategoryCode.toCode(), fhirCategoryCode.getDisplay())));
} else {
throw new IllegalStateException("Unknown observation category " + category);
}
}
if (!categoryCode.getCoding().isEmpty()) {
fhirObservation.setCategory(Collections.singletonList(categoryCode));
}
}
开发者ID:elexis,项目名称:elexis-3-core,代码行数:27,代码来源:ObservationAccessor.java
示例13: convertCondition20
import org.hl7.fhir.dstu3.model.Coding; //导入依赖的package包/类
@Test
public void convertCondition20() throws IOException {
// condition format of HAPI FHIR 2.0
String oldContent = AllTests.getResourceAsString("/rsc/json/ConditionFormat20.json");
assertFalse(FindingsFormatUtil.isCurrentFindingsFormat(oldContent));
Optional<String> newContent = FindingsFormatUtil.convertToCurrentFindingsFormat(oldContent);
assertTrue(newContent.isPresent());
IBaseResource resource = AllTests.getJsonParser().parseResource(newContent.get());
assertTrue(resource instanceof Condition);
Condition condition = (Condition) resource;
// category changed from diagnosis to problem-list-item
List<CodeableConcept> category = condition.getCategory();
assertFalse(category.isEmpty());
CodeableConcept code = category.get(0);
List<Coding> coding = code.getCoding();
assertFalse(coding.isEmpty());
assertTrue(coding.get(0).getCode().equals(ConditionCategory.PROBLEMLISTITEM.getCode()));
// dateRecorded changed to assertedDate
Date assertedDate = condition.getAssertedDate();
assertNotNull(assertedDate);
}
开发者ID:elexis,项目名称:elexis-3-core,代码行数:25,代码来源:FindingsFormatUtilTest.java
示例14: findCode
import org.hl7.fhir.dstu3.model.Coding; //导入依赖的package包/类
@Override
public ConceptEntity findCode(Coding coding) {
ConceptEntity conceptEntity = null;
CriteriaBuilder builder = em.getCriteriaBuilder();
CriteriaQuery<ConceptEntity> criteria = builder.createQuery(ConceptEntity.class);
Root<ConceptEntity> root = criteria.from(ConceptEntity.class);
List<Predicate> predList = new LinkedList<Predicate>();
List<ConceptEntity> results = new ArrayList<ConceptEntity>();
Join<ConceptEntity,CodeSystemRepository> join = root.join("codeSystemEntity");
log.debug("Looking for code ="+coding.getCode()+" in "+coding.getSystem());
Predicate pcode = builder.equal(root.get("code"), coding.getCode());
predList.add(pcode);
Predicate psystem = builder.equal(join.get("codeSystemUri"), coding.getSystem());
predList.add(psystem);
Predicate[] predArray = new Predicate[predList.size()];
predList.toArray(predArray);
criteria.select(root).where(predArray);
TypedQuery<ConceptEntity> qry = em.createQuery(criteria);
qry.setHint("javax.persistence.cache.storeMode", "REFRESH");
List<ConceptEntity> qryResults = qry.getResultList();
for (ConceptEntity concept : qryResults) {
conceptEntity = concept;
log.debug("Found for code="+coding.getCode()+" ConceptEntity.Id="+conceptEntity.getId());
break;
}
return conceptEntity;
}
开发者ID:nhsconnect,项目名称:careconnect-reference-implementation,代码行数:40,代码来源:ConceptDao.java
示例15: extractTokensFromCoding
import org.hl7.fhir.dstu3.model.Coding; //导入依赖的package包/类
private void extractTokensFromCoding(List<String> systems, List<String> codes, RuntimeSearchParam searchParam,
Coding coding, Set<AbstractSearchParam> values) {
if (coding != null && !coding.isEmpty()) {
String nextSystem = coding.getSystemElement().getValueAsString();
String nextCode = coding.getCodeElement().getValue();
if (isNotBlank(nextSystem) || isNotBlank(nextCode)) {
systems.add(nextSystem);
codes.add(nextCode);
}
}
}
开发者ID:jmiddleton,项目名称:cassandra-fhir-index,代码行数:13,代码来源:TokenSearchParameterExtractor.java
示例16: createGranularConsent
import org.hl7.fhir.dstu3.model.Coding; //导入依赖的package包/类
private Consent createGranularConsent(gov.samhsa.c2s.pcm.domain.consent.Consent c2sConsent, PatientDto patientDto) {
// get basic consent details
Consent fhirConsent = createBasicConsent(c2sConsent, patientDto);
// get obligations from consent
List<String> excludeCodes = getConsentObligations(c2sConsent);
List<Coding> excludeCodingList = new ArrayList<>();
List<Coding> includeCodingList = new ArrayList<>();
// go over full list and add obligation as exclusions
for (SensitivePolicyCodeEnum codesEnum : SensitivePolicyCodeEnum.values()) {
if (excludeCodes.contains(codesEnum.getCode())) {
// exclude it
excludeCodingList.add(new Coding(codesEnum.getCodeSystem(), codesEnum.getCode(), codesEnum.getDisplayName()));
} else {
// include it
includeCodingList.add(new Coding(codesEnum.getCodeSystem(), codesEnum.getCode(), codesEnum.getDisplayName()));
}
}
// add list to consent
Consent.ExceptComponent exceptComponent = new Consent.ExceptComponent();
if(fhirProperties.isKeepExcludeList()) {
//List of Excluded Sensitive policy codes
exceptComponent.setType(Consent.ConsentExceptType.DENY);
exceptComponent.setSecurityLabel(excludeCodingList);
} else {
//List of included Sensitive policy codes
exceptComponent.setSecurityLabel(includeCodingList);
exceptComponent.setType(Consent.ConsentExceptType.PERMIT);
}
fhirConsent.setExcept(Collections.singletonList(exceptComponent));
//logs FHIRConsent into json and xml format in debug mode
logFHIRConsent(fhirConsent);
return fhirConsent;
}
开发者ID:bhits,项目名称:pcm-api,代码行数:41,代码来源:FhirConsentServiceImpl.java
示例17: getClass_
import org.hl7.fhir.dstu3.model.Coding; //导入依赖的package包/类
public Coding getClass_()
{
try
{
return adaptedClass.getClass_();
}
catch (Exception e)
{
throw new RuntimeException("Error getting Class_", e);
}
}
开发者ID:cqframework,项目名称:qicore_model,代码行数:12,代码来源:qicoreencounterAdapter.java
示例18: getModalityList
import org.hl7.fhir.dstu3.model.Coding; //导入依赖的package包/类
public List<Coding> getModalityList()
{
try
{
return adaptedClass.getModalityList();
}
catch (Exception e)
{
throw new RuntimeException("Error getting ModalityList", e);
}
}
开发者ID:cqframework,项目名称:qicore_model,代码行数:12,代码来源:qicoreimagingstudyAdapter.java
示例19: getCoding
import org.hl7.fhir.dstu3.model.Coding; //导入依赖的package包/类
public List<Coding> getCoding()
{
try
{
return adaptedClass.getCoding();
}
catch (Exception e)
{
throw new RuntimeException("Error getting Coding", e);
}
}
开发者ID:cqframework,项目名称:qicore_model,代码行数:12,代码来源:qicorepractitionerSpecialtyAdapter.java
示例20: checkCodeMembership
import org.hl7.fhir.dstu3.model.Coding; //导入依赖的package包/类
public boolean checkCodeMembership(Object codeObj, String vsId) {
Iterable<Coding> conceptCodes = ((CodeableConcept)codeObj).getCoding();
for (Coding code : conceptCodes) {
if (terminologyProvider.in(new Code()
.withCode(code.getCodeElement().getValue())
.withSystem(code.getSystem()),
new ValueSetInfo().withId(vsId)))
{
return true;
}
}
return false;
}
开发者ID:DBCG,项目名称:cql_engine,代码行数:14,代码来源:FileBasedFhirProvider.java
注:本文中的org.hl7.fhir.dstu3.model.Coding类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论