本文整理汇总了Java中org.hl7.fhir.exceptions.FHIRException类的典型用法代码示例。如果您正苦于以下问题:Java FHIRException类的具体用法?Java FHIRException怎么用?Java FHIRException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FHIRException类属于org.hl7.fhir.exceptions包,在下文中一共展示了FHIRException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testCreateSimpleMappings
import org.hl7.fhir.exceptions.FHIRException; //导入依赖的package包/类
@Test
public void testCreateSimpleMappings() throws FHIRException {
ConceptMaps maps = ConceptMaps.getEmpty(spark)
.withConceptMaps(conceptMap("urn:cerner:map:testmap", "1"),
conceptMap("urn:cerner:map:othermap", "1"));
Dataset<Mapping> mappings = maps.getMappings();
Assert.assertEquals(2, mappings.count());
ConceptMap firstMap = maps.getConceptMap("urn:cerner:map:testmap", "1");
checkMap(firstMap, "urn:cerner:map:testmap", "1");
ConceptMap secondMap = maps.getConceptMap("urn:cerner:map:othermap", "1");
checkMap(secondMap, "urn:cerner:map:othermap", "1");
}
示例2: testAppendMappings
import org.hl7.fhir.exceptions.FHIRException; //导入依赖的package包/类
@Test
public void testAppendMappings() throws FHIRException {
ConceptMaps original = ConceptMaps.getEmpty(spark)
.withConceptMaps(conceptMap("urn:cerner:map:testmap", "1"),
conceptMap("urn:cerner:map:othermap", "1"));
ConceptMaps maps = original.withConceptMaps(
conceptMap("urn:cerner:map:newmap", "1"));
// The original should be unchanged.
Assert.assertEquals(2, original.getMappings().count());
Assert.assertEquals(3, maps.getMappings().count());
ConceptMap firstMap = maps.getConceptMap("urn:cerner:map:testmap", "1");
checkMap(firstMap, "urn:cerner:map:testmap", "1");
ConceptMap secondMap = maps.getConceptMap("urn:cerner:map:othermap", "1");
checkMap(secondMap, "urn:cerner:map:othermap", "1");
ConceptMap newMap = maps.getConceptMap("urn:cerner:map:newmap", "1");
checkMap(newMap, "urn:cerner:map:newmap", "1");
}
示例3: apply
import org.hl7.fhir.exceptions.FHIRException; //导入依赖的package包/类
@Operation(name = "$apply", idempotent = true)
public Resource apply(@IdParam IdType theId, @RequiredParam(name="patient") String patientId,
@OptionalParam(name="encounter") String encounterId,
@OptionalParam(name="practitioner") String practitionerId,
@OptionalParam(name="organization") String organizationId,
@OptionalParam(name="userType") String userType,
@OptionalParam(name="userLanguage") String userLanguage,
@OptionalParam(name="userTaskContext") String userTaskContext,
@OptionalParam(name="setting") String setting,
@OptionalParam(name="settingContext") String settingContext)
throws InternalErrorException, FHIRException, ClassNotFoundException, IllegalAccessException,
InstantiationException, ActivityDefinitionApplyException
{
ActivityDefinition activityDefinition = this.getDao().read(theId);
return resolveActivityDefinition(activityDefinition, patientId, practitionerId, organizationId);
}
示例4: setProperty
import org.hl7.fhir.exceptions.FHIRException; //导入依赖的package包/类
@Override
public Base setProperty(String name, Base value) throws FHIRException {
if (name.equals("origin")) {
this.origin = castToSimpleQuantity(value); // SimpleQuantity
} else if (name.equals("period")) {
this.period = castToDecimal(value); // DecimalType
} else if (name.equals("factor")) {
this.factor = castToDecimal(value); // DecimalType
} else if (name.equals("lowerLimit")) {
this.lowerLimit = castToDecimal(value); // DecimalType
} else if (name.equals("upperLimit")) {
this.upperLimit = castToDecimal(value); // DecimalType
} else if (name.equals("dimensions")) {
this.dimensions = castToPositiveInt(value); // PositiveIntType
} else if (name.equals("data")) {
this.data = castToString(value); // StringType
} else
return super.setProperty(name, value);
return value;
}
示例5: fromCode
import org.hl7.fhir.exceptions.FHIRException; //导入依赖的package包/类
public static AuditEventAgentNetworkType fromCode(String codeString) throws FHIRException {
if (codeString == null || "".equals(codeString))
return null;
if ("1".equals(codeString))
return _1;
if ("2".equals(codeString))
return _2;
if ("3".equals(codeString))
return _3;
if ("4".equals(codeString))
return _4;
if ("5".equals(codeString))
return _5;
if (Configuration.isAcceptInvalidEnums())
return null;
else
throw new FHIRException("Unknown AuditEventAgentNetworkType code '"+codeString+"'");
}
示例6: addChild
import org.hl7.fhir.exceptions.FHIRException; //导入依赖的package包/类
@Override
public Base addChild(String name) throws FHIRException {
if (name.equals("endpoint")) {
return addEndpoint();
}
else if (name.equals("reliableCache")) {
throw new FHIRException("Cannot call addChild on a primitive type Conformance.reliableCache");
}
else if (name.equals("documentation")) {
throw new FHIRException("Cannot call addChild on a primitive type Conformance.documentation");
}
else if (name.equals("event")) {
return addEvent();
}
else
return super.addChild(name);
}
示例7: convertMoney
import org.hl7.fhir.exceptions.FHIRException; //导入依赖的package包/类
public static org.hl7.fhir.dstu3.model.Money convertMoney(org.hl7.fhir.dstu2016may.model.Money src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Money tgt = new org.hl7.fhir.dstu3.model.Money();
copyElement(src, tgt);
if (src.hasValue())
tgt.setValue(src.getValue());
tgt.setComparator(convertQuantityComparator(src.getComparator()));
if (src.hasUnit())
tgt.setUnit(src.getUnit());
if (src.hasSystem())
tgt.setSystem(src.getSystem());
if (src.hasCode())
tgt.setCode(src.getCode());
return tgt;
}
示例8: makeProperty
import org.hl7.fhir.exceptions.FHIRException; //导入依赖的package包/类
@Override
public Base makeProperty(int hash, String name) throws FHIRException {
switch (hash) {
case 50511102: return getCategory();
case -1014418093: return getDefinition();
case 3059181: return getCode();
case 722137681: return addReasonCode();
case -1146218137: return addReasonReference();
case 3178259: return addGoal();
case -892481550: return getStatusElement();
case 2051346646: return getStatusReasonElement();
case 663275198: return getProhibitedElement();
case 1162627251: return getScheduled();
case -160710483: return getScheduled();
case 1901043637: return getLocation();
case 481140686: return addPerformer();
case 1753005361: return getProduct();
case -309474065: return getProduct();
case -768908335: return getDailyAmount();
case -1285004149: return getQuantity();
case -1724546052: return getDescriptionElement();
default: return super.makeProperty(hash, name);
}
}
示例9: addChild
import org.hl7.fhir.exceptions.FHIRException; //导入依赖的package包/类
@Override
public Base addChild(String name) throws FHIRException {
if (name.equals("number")) {
throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.number");
}
else if (name.equals("type")) {
this.type = new CodeableConcept();
return this.type;
}
else if (name.equals("text")) {
throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.text");
}
else if (name.equals("language")) {
this.language = new CodeableConcept();
return this.language;
}
else
return super.addChild(name);
}
示例10: fromType
import org.hl7.fhir.exceptions.FHIRException; //导入依赖的package包/类
public Enumeration<FilterOperator> fromType(Base code) throws FHIRException {
if (code == null || code.isEmpty())
return null;
String codeString = ((PrimitiveType) code).asStringValue();
if (codeString == null || "".equals(codeString))
return null;
if ("=".equals(codeString))
return new Enumeration<FilterOperator>(this, FilterOperator.EQUAL);
if ("is-a".equals(codeString))
return new Enumeration<FilterOperator>(this, FilterOperator.ISA);
if ("is-not-a".equals(codeString))
return new Enumeration<FilterOperator>(this, FilterOperator.ISNOTA);
if ("regex".equals(codeString))
return new Enumeration<FilterOperator>(this, FilterOperator.REGEX);
if ("in".equals(codeString))
return new Enumeration<FilterOperator>(this, FilterOperator.IN);
if ("not-in".equals(codeString))
return new Enumeration<FilterOperator>(this, FilterOperator.NOTIN);
throw new FHIRException("Unknown FilterOperator code '"+codeString+"'");
}
示例11: fromType
import org.hl7.fhir.exceptions.FHIRException; //导入依赖的package包/类
public Enumeration<MediaStatus> fromType(Base code) throws FHIRException {
if (code == null)
return null;
if (code.isEmpty())
return new Enumeration<MediaStatus>(this);
String codeString = ((PrimitiveType) code).asStringValue();
if (codeString == null || "".equals(codeString))
return null;
if ("preparation".equals(codeString))
return new Enumeration<MediaStatus>(this, MediaStatus.PREPARATION);
if ("in-progress".equals(codeString))
return new Enumeration<MediaStatus>(this, MediaStatus.INPROGRESS);
if ("not-done".equals(codeString))
return new Enumeration<MediaStatus>(this, MediaStatus.NOTDONE);
if ("suspended".equals(codeString))
return new Enumeration<MediaStatus>(this, MediaStatus.SUSPENDED);
if ("aborted".equals(codeString))
return new Enumeration<MediaStatus>(this, MediaStatus.ABORTED);
if ("completed".equals(codeString))
return new Enumeration<MediaStatus>(this, MediaStatus.COMPLETED);
if ("entered-in-error".equals(codeString))
return new Enumeration<MediaStatus>(this, MediaStatus.ENTEREDINERROR);
if ("unknown".equals(codeString))
return new Enumeration<MediaStatus>(this, MediaStatus.UNKNOWN);
throw new FHIRException("Unknown MediaStatus code '"+codeString+"'");
}
示例12: setProperty
import org.hl7.fhir.exceptions.FHIRException; //导入依赖的package包/类
@Override
public Base setProperty(int hash, String name, Base value) throws FHIRException {
switch (hash) {
case 116103: // use
value = new IdentifierUseEnumFactory().fromType(castToCode(value));
this.use = (Enumeration) value; // Enumeration<IdentifierUse>
return value;
case 3575610: // type
this.type = castToCodeableConcept(value); // CodeableConcept
return value;
case -887328209: // system
this.system = castToUri(value); // UriType
return value;
case 111972721: // value
this.value = castToString(value); // StringType
return value;
case -991726143: // period
this.period = castToPeriod(value); // Period
return value;
case -369881636: // assigner
this.assigner = castToReference(value); // Reference
return value;
default: return super.setProperty(hash, name, value);
}
}
示例13: getProperty
import org.hl7.fhir.exceptions.FHIRException; //导入依赖的package包/类
@Override
public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
if (isPrimitive() && (hash == "value".hashCode()) && !Utilities.noString(value)) {
// String tn = getType();
// throw new Error(tn+" not done yet");
Base[] b = new Base[1];
b[0] = new StringType(value);
return b;
}
List<Base> result = new ArrayList<Base>();
if (children != null) {
for (Element child : children) {
if (child.getName().equals(name))
result.add(child);
if (child.getName().startsWith(name) && child.getProperty().isChoice() && child.getProperty().getName().equals(name+"[x]"))
result.add(child);
}
}
if (result.isEmpty() && checkValid) {
// throw new FHIRException("not determined yet");
}
return result.toArray(new Base[result.size()]);
}
示例14: setProperty
import org.hl7.fhir.exceptions.FHIRException; //导入依赖的package包/类
@Override
public Base setProperty(String name, Base value) throws FHIRException {
if (name.equals("sequenceLinkId")) {
this.getSequenceLinkId().add(castToPositiveInt(value));
} else if (name.equals("revenue")) {
this.revenue = castToCodeableConcept(value); // CodeableConcept
} else if (name.equals("category")) {
this.category = castToCodeableConcept(value); // CodeableConcept
} else if (name.equals("service")) {
this.service = castToCodeableConcept(value); // CodeableConcept
} else if (name.equals("modifier")) {
this.getModifier().add(castToCodeableConcept(value));
} else if (name.equals("fee")) {
this.fee = castToMoney(value); // Money
} else if (name.equals("noteNumber")) {
this.getNoteNumber().add(castToPositiveInt(value));
} else if (name.equals("adjudication")) {
this.getAdjudication().add((AdjudicationComponent) value);
} else if (name.equals("detail")) {
this.getDetail().add((AddedItemsDetailComponent) value);
} else
return super.setProperty(name, value);
return value;
}
示例15: fromCode
import org.hl7.fhir.exceptions.FHIRException; //导入依赖的package包/类
public static DataAbsentReason fromCode(String codeString) throws FHIRException {
if (codeString == null || "".equals(codeString))
return null;
if ("unknown".equals(codeString))
return UNKNOWN;
if ("asked".equals(codeString))
return ASKED;
if ("temp".equals(codeString))
return TEMP;
if ("not-asked".equals(codeString))
return NOTASKED;
if ("masked".equals(codeString))
return MASKED;
if ("unsupported".equals(codeString))
return UNSUPPORTED;
if ("astext".equals(codeString))
return ASTEXT;
if ("error".equals(codeString))
return ERROR;
if ("NaN".equals(codeString))
return NAN;
throw new FHIRException("Unknown DataAbsentReason code '"+codeString+"'");
}