use of org.hl7.fhir.instance.model.api.IAnyResource in project beneficiary-fhir-data by CMSgov.
the class TransformerUtilsV2 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 quality-measure-and-cohort-service by Alvearie.
the class CohortCLI method prettyPrintValue.
private String prettyPrintValue(Object value) {
String retVal;
if (value != null) {
if (value instanceof IAnyResource) {
IAnyResource resource = (IAnyResource) value;
retVal = resource.getId();
} else if (value instanceof Collection) {
Collection<?> collection = (Collection<?>) value;
retVal = "Collection: " + collection.size();
} else {
retVal = value.toString();
}
} else {
retVal = "null";
}
return retVal;
}
Aggregations