check inactive property as well as status property when checking for active codes

This commit is contained in:
Grahame Grieve 2022-09-01 22:42:01 +10:00
parent 8e6cd3c16c
commit 157fd68eca
1 changed files with 5 additions and 1 deletions

View File

@ -326,8 +326,12 @@ public class CodeSystemUtilities {
public static boolean isInactive(CodeSystem cs, ConceptDefinitionComponent def) throws FHIRException {
for (ConceptPropertyComponent p : def.getProperty()) {
if ("status".equals(p.getCode()) && p.hasValueStringType())
if ("status".equals(p.getCode()) && p.hasValueStringType()) {
return "inactive".equals(p.getValueStringType().primitiveValue()) || "retired".equals(p.getValueStringType().primitiveValue());
}
if ("inactive".equals(p.getCode()) && p.hasValueBooleanType()) {
return p.getValueBooleanType().getValue();
}
}
return false;
}