use of org.hl7.fhir.instance.model.api.IAnyResource in project beneficiary-fhir-data by CMSgov.
the class TransformerUtils method createExtensionCoding.
/**
* @param rootResource the root FHIR {@link IAnyResource} that the resultant {@link Extension}
* will be contained in
* @param ccwVariable the {@link CcwCodebookInterface} being coded
* @param code the value to use for {@link Coding#getCode()} for the resulting {@link Coding}
* @return the output {@link Extension}, with {@link Extension#getValue()} set to a new {@link
* Coding} to represent the specified input values
*/
static Extension createExtensionCoding(IAnyResource rootResource, CcwCodebookInterface ccwVariable, Optional<?> code) {
if (!code.isPresent())
throw new IllegalArgumentException();
Coding coding = createCoding(rootResource, ccwVariable, code.get());
String extensionUrl = CCWUtils.calculateVariableReferenceUrl(ccwVariable);
Extension extension = new Extension(extensionUrl, coding);
return extension;
}
use of org.hl7.fhir.instance.model.api.IAnyResource in project beneficiary-fhir-data by CMSgov.
the class TransformerUtils method createExtensionCoding.
/**
* @param rootResource the root FHIR {@link IAnyResource} that the resultant {@link Extension}
* will be contained in
* @param ccwVariable the {@link CcwCodebookInterface being coded
* @param code the value to use for {@link Coding#getCode()} for the resulting {@link Coding}
* @return the output {@link Extension}, with {@link Extension#getValue()} set to a new {@link
* Coding} to represent the specified input values
*/
static Extension createExtensionCoding(IAnyResource rootResource, CcwCodebookInterface ccwVariable, String yearMonth, Optional<?> code) {
if (!code.isPresent())
throw new IllegalArgumentException();
Coding coding = createCoding(rootResource, ccwVariable, yearMonth, code.get());
String extensionUrl = String.format("%s/%s", CCWUtils.calculateVariableReferenceUrl(ccwVariable), yearMonth);
Extension extension = new Extension(extensionUrl, coding);
return extension;
}
use of org.hl7.fhir.instance.model.api.IAnyResource in project beneficiary-fhir-data by CMSgov.
the class TransformerUtils method createCodeableConcept.
/**
* @param rootResource the root FHIR {@link IAnyResource} that the resultant {@link
* CodeableConcept} will be contained in
* @param ccwVariable the {@link CcwCodebookInterface} being coded
* @param code the value to use for {@link Coding#getCode()} for the resulting (single) {@link
* Coding}, wrapped within the resulting {@link CodeableConcept}
* @return the output {@link CodeableConcept} for the specified input values
*/
static CodeableConcept createCodeableConcept(IAnyResource rootResource, CcwCodebookInterface ccwVariable, Optional<?> code) {
if (!code.isPresent())
throw new IllegalArgumentException();
Coding coding = createCoding(rootResource, ccwVariable, code.get());
CodeableConcept concept = new CodeableConcept();
concept.addCoding(coding);
return concept;
}
use of org.hl7.fhir.instance.model.api.IAnyResource in project beneficiary-fhir-data by CMSgov.
the class TransformerUtilsV2 method createCodeableConcept.
/**
* @param rootResource the root FHIR {@link IAnyResource} that the resultant {@link
* CodeableConcept} will be contained in
* @param ccwVariable the {@link CcwCodebookInterface} being coded
* @param code the value to use for {@link Coding#getCode()} for the resulting (single) {@link
* Coding}, wrapped within the resulting {@link CodeableConcept}
* @return the output {@link CodeableConcept} for the specified input values
*/
static CodeableConcept createCodeableConcept(IAnyResource rootResource, CcwCodebookInterface ccwVariable, Optional<?> code) {
if (!code.isPresent()) {
throw new IllegalArgumentException();
}
Coding coding = createCoding(rootResource, ccwVariable, code.get());
CodeableConcept concept = new CodeableConcept();
concept.addCoding(coding);
return concept;
}
use of org.hl7.fhir.instance.model.api.IAnyResource in project beneficiary-fhir-data by CMSgov.
the class TransformerUtilsV2 method createCodeableConceptForFieldId.
/**
* Unlike {@link #createCodeableConcept(IAnyResource, CcwCodebookInterface, Optional)}, this
* method creates a {@link CodeableConcept} that's intended for use as a field ID/discriminator:
* the {@link Variable#getId()} will be used for the {@link Coding#getCode()}, rather than the
* {@link Coding#getSystem()}.
*
* @param rootResource the root FHIR {@link IAnyResource} that the resultant {@link
* CodeableConcept} will be contained in
* @param codingSystem the {@link Coding#getSystem()} to use
* @param ccwVariable the {@link CcwCodebookInterface} being coded
* @return the output {@link CodeableConcept} for the specified input values
*/
private static CodeableConcept createCodeableConceptForFieldId(IAnyResource rootResource, String codingSystem, CcwCodebookInterface ccwVariable) {
String code = CCWUtils.calculateVariableReferenceUrl(ccwVariable);
Coding carinCoding = new Coding().setCode("info").setSystem(TransformerConstants.CARIN_SUPPORTING_INFO_TYPE).setDisplay("Information");
Coding cmsBBcoding = new Coding(codingSystem, code, ccwVariable.getVariable().getLabel());
CodeableConcept categoryCodeableConcept = new CodeableConcept();
categoryCodeableConcept.addCoding(carinCoding);
categoryCodeableConcept.addCoding(cmsBBcoding);
return categoryCodeableConcept;
}
Aggregations