Merge branch 'master' of github.com:jamesagnew/hapi-fhir
This commit is contained in:
commit
ecb8da7aea
|
@ -27,7 +27,7 @@
|
|||
{
|
||||
"title": "clinFHIR",
|
||||
"contactName": "David Hay",
|
||||
"contactEmail": "davidhay@gmail.com",
|
||||
"contactEmail": "david.hay25@gmail.com",
|
||||
"link": "http://clinfhir.com",
|
||||
"lat": -42.651737,
|
||||
"lon": 171.926909,
|
||||
|
@ -151,7 +151,7 @@
|
|||
{
|
||||
"title": "Trifork",
|
||||
"description": "National Telemedicine Project",
|
||||
"link": "https://ehealth-documentation.s3-eu-west-1.amazonaws.com/latest/ig/index.html",
|
||||
"link": "https://docs.ehealth.sundhed.dk/latest/ig/index.html",
|
||||
"contactName": "Jens Villadsen",
|
||||
"contactEmail": "jvi@trifork.com",
|
||||
"city": "Aarhus, Denmark",
|
||||
|
|
|
@ -40,3 +40,14 @@
|
|||
issue: "1610"
|
||||
type: "fix"
|
||||
title: "A missing mandatory was added to the SNOMED CT CodeSystem that is uploaded when SCT is uploaded to the JPA server. Thanks to Anders Havn for the pull request!"
|
||||
- item:
|
||||
issue: 1643
|
||||
type: fix
|
||||
title: "When validating resources containing custom valuesets defined in PrePopulatedValidationSupport
|
||||
outside of the JPA server, sometimes code systems could not be found resulting in false negative
|
||||
errors."
|
||||
- item:
|
||||
issue: 1588
|
||||
type: add
|
||||
title: "Support for several new operators has been added to the `_filter` support in the JPA server. Thanks
|
||||
to Anthony Sute for the Pull Request!
|
||||
|
|
|
@ -547,16 +547,20 @@ public class SearchBuilder implements ISearchBuilder {
|
|||
List<ResourcePersistentId> targetPids = myIdHelperService.translateForcedIdToPids(targetIds, theRequest);
|
||||
if (!targetPids.isEmpty()) {
|
||||
ourLog.debug("Searching for resource link with target PIDs: {}", targetPids);
|
||||
Predicate pathPredicate = createResourceLinkPathPredicate(theResourceName, theParamName, join);
|
||||
Predicate pidPredicate = join.get("myTargetResourcePid").in(ResourcePersistentId.toLongList(targetPids));
|
||||
Predicate pathPredicate = ((operation == null) || (operation == SearchFilterParser.CompareOperation.eq)) ? createResourceLinkPathPredicate(theResourceName, theParamName, join)
|
||||
: createResourceLinkPathPredicate(theResourceName, theParamName, join).not();
|
||||
Predicate pidPredicate = ((operation == null) || (operation == SearchFilterParser.CompareOperation.eq)) ? join.get("myTargetResourcePid").in(targetPids)
|
||||
: join.get("myTargetResourcePid").in(targetPids).not();
|
||||
codePredicates.add(myBuilder.and(pathPredicate, pidPredicate));
|
||||
}
|
||||
|
||||
// Resources by fully qualified URL
|
||||
if (!targetQualifiedUrls.isEmpty()) {
|
||||
ourLog.debug("Searching for resource link with target URLs: {}", targetQualifiedUrls);
|
||||
Predicate pathPredicate = createResourceLinkPathPredicate(theResourceName, theParamName, join);
|
||||
Predicate pidPredicate = join.get("myTargetResourceUrl").in(targetQualifiedUrls);
|
||||
Predicate pathPredicate = ((operation == null) || (operation == SearchFilterParser.CompareOperation.eq)) ? createResourceLinkPathPredicate(theResourceName, theParamName, join)
|
||||
: createResourceLinkPathPredicate(theResourceName, theParamName, join).not();
|
||||
Predicate pidPredicate = ((operation == null) || (operation == SearchFilterParser.CompareOperation.eq)) ? join.get("myTargetResourceUrl").in(targetQualifiedUrls)
|
||||
: join.get("myTargetResourceUrl").in(targetQualifiedUrls).not();
|
||||
codePredicates.add(myBuilder.and(pathPredicate, pidPredicate));
|
||||
}
|
||||
|
||||
|
@ -1466,29 +1470,9 @@ public class SearchBuilder implements ISearchBuilder {
|
|||
BigDecimal theValue,
|
||||
final Expression<BigDecimal> thePath,
|
||||
String invalidMessageName) {
|
||||
return createPredicateNumeric(theResourceName,
|
||||
theParamName,
|
||||
theFrom,
|
||||
builder,
|
||||
theParam,
|
||||
thePrefix,
|
||||
theValue,
|
||||
thePath,
|
||||
invalidMessageName,
|
||||
null);
|
||||
}
|
||||
|
||||
private Predicate createPredicateNumeric(String theResourceName,
|
||||
String theParamName,
|
||||
From<?, ? extends BaseResourceIndexedSearchParam> theFrom,
|
||||
CriteriaBuilder builder,
|
||||
IQueryParameterType theParam,
|
||||
ParamPrefixEnum thePrefix,
|
||||
BigDecimal theValue,
|
||||
final Expression<BigDecimal> thePath,
|
||||
String invalidMessageName,
|
||||
SearchFilterParser.CompareOperation operation) {
|
||||
Predicate num;
|
||||
// Per discussions with Grahame Grieve and James Agnew on 11/13/19, modified logic for EQUAL and NOT_EQUAL operators below so as to
|
||||
// use exact value matching. The "fuzz amount" matching is still used with the APPROXIMATE operator.
|
||||
switch (thePrefix) {
|
||||
case GREATERTHAN:
|
||||
num = builder.gt(thePath, theValue);
|
||||
|
@ -1502,25 +1486,22 @@ public class SearchBuilder implements ISearchBuilder {
|
|||
case LESSTHAN_OR_EQUALS:
|
||||
num = builder.le(thePath, theValue);
|
||||
break;
|
||||
case APPROXIMATE:
|
||||
case EQUAL:
|
||||
num = builder.equal(thePath, theValue);
|
||||
break;
|
||||
case NOT_EQUAL:
|
||||
num = builder.notEqual(thePath, theValue);
|
||||
break;
|
||||
case APPROXIMATE:
|
||||
BigDecimal mul = calculateFuzzAmount(thePrefix, theValue);
|
||||
BigDecimal low = theValue.subtract(mul, MathContext.DECIMAL64);
|
||||
BigDecimal high = theValue.add(mul, MathContext.DECIMAL64);
|
||||
Predicate lowPred;
|
||||
Predicate highPred;
|
||||
if (thePrefix != ParamPrefixEnum.NOT_EQUAL) {
|
||||
lowPred = builder.ge(thePath.as(BigDecimal.class), low);
|
||||
highPred = builder.le(thePath.as(BigDecimal.class), high);
|
||||
num = builder.and(lowPred, highPred);
|
||||
ourLog.trace("Searching for {} <= val <= {}", low, high);
|
||||
} else {
|
||||
// Prefix was "ne", so reverse it!
|
||||
lowPred = builder.lt(thePath.as(BigDecimal.class), low);
|
||||
highPred = builder.gt(thePath.as(BigDecimal.class), high);
|
||||
num = builder.or(lowPred, highPred);
|
||||
}
|
||||
lowPred = builder.ge(thePath.as(BigDecimal.class), low);
|
||||
highPred = builder.le(thePath.as(BigDecimal.class), high);
|
||||
num = builder.and(lowPred, highPred);
|
||||
ourLog.trace("Searching for {} <= val <= {}", low, high);
|
||||
break;
|
||||
case ENDS_BEFORE:
|
||||
case STARTS_AFTER:
|
||||
|
@ -1720,35 +1701,39 @@ public class SearchBuilder implements ISearchBuilder {
|
|||
|
||||
boolean exactMatch = theParameter instanceof StringParam && ((StringParam) theParameter).isExact();
|
||||
if (exactMatch) {
|
||||
|
||||
// Exact match
|
||||
|
||||
Long hash = ResourceIndexedSearchParamString.calculateHashExact(theResourceName, theParamName, rawSearchTerm);
|
||||
return theBuilder.equal(theFrom.get("myHashExact").as(Long.class), hash);
|
||||
|
||||
} else {
|
||||
|
||||
// Normalized Match
|
||||
|
||||
String normalizedString = StringNormalizer.normalizeString(rawSearchTerm);
|
||||
String likeExpression;
|
||||
if (theParameter instanceof StringParam &&
|
||||
((StringParam) theParameter).isContains() &&
|
||||
myDaoConfig.isAllowContainsSearches()) {
|
||||
if ((theParameter instanceof StringParam) &&
|
||||
(((((StringParam) theParameter).isContains()) &&
|
||||
(myCallingDao.getConfig().isAllowContainsSearches())) ||
|
||||
(operation == SearchFilterParser.CompareOperation.co))) {
|
||||
likeExpression = createLeftAndRightMatchLikeExpression(normalizedString);
|
||||
} else if ((operation != SearchFilterParser.CompareOperation.ne) &&
|
||||
(operation != SearchFilterParser.CompareOperation.gt) &&
|
||||
(operation != SearchFilterParser.CompareOperation.lt) &&
|
||||
(operation != SearchFilterParser.CompareOperation.ge) &&
|
||||
(operation != SearchFilterParser.CompareOperation.le)) {
|
||||
if (operation == SearchFilterParser.CompareOperation.ew) {
|
||||
likeExpression = createRightMatchLikeExpression(normalizedString);
|
||||
} else {
|
||||
likeExpression = createLeftMatchLikeExpression(normalizedString);
|
||||
}
|
||||
} else {
|
||||
likeExpression = createLeftMatchLikeExpression(normalizedString);
|
||||
likeExpression = normalizedString;
|
||||
}
|
||||
|
||||
Predicate predicate;
|
||||
if ((operation == null) ||
|
||||
(operation == SearchFilterParser.CompareOperation.sw) ||
|
||||
(operation == SearchFilterParser.CompareOperation.ew)) {
|
||||
|
||||
Long hash = ResourceIndexedSearchParamString.calculateHashNormalized(myDaoConfig.getModelConfig(), theResourceName, theParamName, normalizedString);
|
||||
Predicate hashCode = theBuilder.equal(theFrom.get("myHashNormalizedPrefix").as(Long.class), hash);
|
||||
(operation == SearchFilterParser.CompareOperation.ew) ||
|
||||
(operation == SearchFilterParser.CompareOperation.co)) {
|
||||
Predicate singleCode = theBuilder.like(theFrom.get("myValueNormalized").as(String.class), likeExpression);
|
||||
predicate = theBuilder.and(hashCode, singleCode);
|
||||
predicate = combineParamIndexPredicateWithParamNamePredicate(theResourceName, theParamName, theFrom, singleCode);
|
||||
} else if (operation == SearchFilterParser.CompareOperation.eq) {
|
||||
Long hash = ResourceIndexedSearchParamString.calculateHashNormalized(myDaoConfig.getModelConfig(), theResourceName, theParamName, normalizedString);
|
||||
Predicate hashCode = theBuilder.equal(theFrom.get("myHashNormalizedPrefix").as(Long.class), hash);
|
||||
|
|
|
@ -211,6 +211,11 @@ public class TermReadSvcR4 extends BaseTermReadSvcImpl implements ITermReadSvcR4
|
|||
return supportsSystem(theSystem);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValueSetSupported(FhirContext theContext, String theValueSetUrl) {
|
||||
return myValidationSupport.fetchResource(myContext, ValueSet.class, theValueSetUrl) != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StructureDefinition generateSnapshot(StructureDefinition theInput, String theUrl, String theWebUrl, String theProfileName) {
|
||||
return null;
|
||||
|
|
|
@ -361,12 +361,12 @@ public class FhirResourceDaoDstu3Test extends BaseJpaDstu3Test {
|
|||
{
|
||||
IBundleProvider found = myObservationDao.search(new SearchParameterMap(Observation.SP_VALUE_QUANTITY, new QuantityParam("123", "foo", "bar")).setLoadSynchronous(true));
|
||||
List<IIdType> list = toUnqualifiedVersionlessIds(found);
|
||||
assertThat(list, containsInAnyOrder(id3));
|
||||
assertThat(list, Matchers.empty());
|
||||
}
|
||||
{
|
||||
IBundleProvider found = myObservationDao.search(new SearchParameterMap(Observation.SP_VALUE_QUANTITY, new QuantityParam("123.0", "foo", "bar")).setLoadSynchronous(true));
|
||||
List<IIdType> list = toUnqualifiedVersionlessIds(found);
|
||||
assertThat(list, containsInAnyOrder(id3));
|
||||
assertThat(list, Matchers.empty());
|
||||
}
|
||||
{
|
||||
IBundleProvider found = myObservationDao.search(new SearchParameterMap(Observation.SP_VALUE_QUANTITY, new QuantityParam("123.01", "foo", "bar")).setLoadSynchronous(true));
|
||||
|
@ -381,12 +381,12 @@ public class FhirResourceDaoDstu3Test extends BaseJpaDstu3Test {
|
|||
{
|
||||
IBundleProvider found = myObservationDao.search(new SearchParameterMap(Observation.SP_VALUE_QUANTITY, new QuantityParam("123.02", "foo", "bar")).setLoadSynchronous(true));
|
||||
List<IIdType> list = toUnqualifiedVersionlessIds(found);
|
||||
assertThat(list, containsInAnyOrder());
|
||||
assertThat(list, Matchers.empty());
|
||||
}
|
||||
{
|
||||
IBundleProvider found = myObservationDao.search(new SearchParameterMap(Observation.SP_VALUE_QUANTITY, new QuantityParam("123.001", "foo", "bar")).setLoadSynchronous(true));
|
||||
List<IIdType> list = toUnqualifiedVersionlessIds(found);
|
||||
assertThat(list, containsInAnyOrder());
|
||||
assertThat(list, Matchers.empty());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -4,20 +4,25 @@ import ca.uhn.fhir.jpa.dao.DaoConfig;
|
|||
import ca.uhn.fhir.jpa.searchparam.SearchParameterMap;
|
||||
import ca.uhn.fhir.jpa.util.TestUtil;
|
||||
import ca.uhn.fhir.rest.api.Constants;
|
||||
import ca.uhn.fhir.rest.api.server.IBundleProvider;
|
||||
import ca.uhn.fhir.rest.param.StringParam;
|
||||
import ca.uhn.fhir.rest.param.UriParam;
|
||||
import ca.uhn.fhir.rest.param.UriParamQualifierEnum;
|
||||
import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException;
|
||||
import org.hamcrest.Matchers;
|
||||
import org.hl7.fhir.instance.model.api.IIdType;
|
||||
import org.hl7.fhir.r4.model.CarePlan;
|
||||
import org.hl7.fhir.r4.model.Patient;
|
||||
import org.hl7.fhir.r4.model.*;
|
||||
import org.junit.After;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import static org.hamcrest.Matchers.containsInAnyOrder;
|
||||
import static org.hamcrest.Matchers.empty;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
@SuppressWarnings({"Duplicates"})
|
||||
|
@ -204,6 +209,966 @@ public class FhirResourceDaoR4FilterTest extends BaseJpaR4Test {
|
|||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testStringComparatorNe() {
|
||||
|
||||
Patient p = new Patient();
|
||||
p.addName().setFamily("Smith").addGiven("John");
|
||||
p.setActive(true);
|
||||
String id1 = myPatientDao.create(p).getId().toUnqualifiedVersionless().getValue();
|
||||
|
||||
p = new Patient();
|
||||
p.addName().setFamily("Jones").addGiven("Frank");
|
||||
p.setActive(false);
|
||||
String id2 = myPatientDao.create(p).getId().toUnqualifiedVersionless().getValue();
|
||||
|
||||
SearchParameterMap map;
|
||||
List<String> found;
|
||||
|
||||
map = new SearchParameterMap();
|
||||
map.setLoadSynchronous(true);
|
||||
map.add(Constants.PARAM_FILTER, new StringParam("family ne smith"));
|
||||
found = toUnqualifiedVersionlessIdValues(myPatientDao.search(map));
|
||||
assertThat(found, containsInAnyOrder(id2));
|
||||
assertThat(found, containsInAnyOrder(Matchers.not(id1)));
|
||||
|
||||
map = new SearchParameterMap();
|
||||
map.setLoadSynchronous(true);
|
||||
map.add(Constants.PARAM_FILTER, new StringParam("family ne jones"));
|
||||
found = toUnqualifiedVersionlessIdValues(myPatientDao.search(map));
|
||||
assertThat(found, containsInAnyOrder(id1));
|
||||
assertThat(found, containsInAnyOrder(Matchers.not(id2)));
|
||||
|
||||
map = new SearchParameterMap();
|
||||
map.setLoadSynchronous(true);
|
||||
map.add(Constants.PARAM_FILTER, new StringParam("given ne john"));
|
||||
found = toUnqualifiedVersionlessIdValues(myPatientDao.search(map));
|
||||
assertThat(found, containsInAnyOrder(id2));
|
||||
assertThat(found, containsInAnyOrder(Matchers.not(id1)));
|
||||
|
||||
map = new SearchParameterMap();
|
||||
map.setLoadSynchronous(true);
|
||||
map.add(Constants.PARAM_FILTER, new StringParam("given ne frank"));
|
||||
found = toUnqualifiedVersionlessIdValues(myPatientDao.search(map));
|
||||
assertThat(found, containsInAnyOrder(id1));
|
||||
assertThat(found, containsInAnyOrder(Matchers.not(id2)));
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testReferenceComparatorNe() {
|
||||
|
||||
Patient p = new Patient();
|
||||
p.addName().setFamily("Smith").addGiven("John");
|
||||
p.setActive(true);
|
||||
IIdType ptId = myPatientDao.create(p).getId().toUnqualifiedVersionless();
|
||||
|
||||
p = new Patient();
|
||||
p.addName().setFamily("Smith").addGiven("John2");
|
||||
p.setActive(true);
|
||||
IIdType ptId2 = myPatientDao.create(p).getId().toUnqualifiedVersionless();
|
||||
|
||||
CarePlan cp = new CarePlan();
|
||||
cp.getSubject().setReference(ptId.getValue());
|
||||
String cpId = myCarePlanDao.create(cp).getId().toUnqualifiedVersionless().getValue();
|
||||
|
||||
cp = new CarePlan();
|
||||
cp.addActivity().getDetail().addPerformer().setReference(ptId2.getValue());
|
||||
String cpId2 = myCarePlanDao.create(cp).getId().toUnqualifiedVersionless().getValue();
|
||||
|
||||
SearchParameterMap map;
|
||||
List<String> found;
|
||||
|
||||
map = new SearchParameterMap();
|
||||
map.setLoadSynchronous(true);
|
||||
map.add(Constants.PARAM_FILTER, new StringParam("subject ne " + ptId.getValue()));
|
||||
found = toUnqualifiedVersionlessIdValues(myCarePlanDao.search(map));
|
||||
assertThat(found, containsInAnyOrder(cpId2));
|
||||
|
||||
map = new SearchParameterMap();
|
||||
map.setLoadSynchronous(true);
|
||||
map.add(Constants.PARAM_FILTER, new StringParam("subject ne " + ptId.getIdPart()));
|
||||
found = toUnqualifiedVersionlessIdValues(myCarePlanDao.search(map));
|
||||
assertThat(found, containsInAnyOrder(cpId2));
|
||||
|
||||
map = new SearchParameterMap();
|
||||
map.setLoadSynchronous(true);
|
||||
map.add(Constants.PARAM_FILTER, new StringParam("(subject ne " + ptId.getIdPart() + ") and (performer ne " + ptId2.getValue() + ")"));
|
||||
found = toUnqualifiedVersionlessIdValues(myCarePlanDao.search(map));
|
||||
assertThat(found, Matchers.empty());
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testStringComparatorCo() {
|
||||
|
||||
Patient p = new Patient();
|
||||
p.addName().setFamily("Smith").addGiven("John");
|
||||
p.setActive(true);
|
||||
String id1 = myPatientDao.create(p).getId().toUnqualifiedVersionless().getValue();
|
||||
|
||||
p = new Patient();
|
||||
p.addName().setFamily("Jones").addGiven("Frank");
|
||||
p.setActive(false);
|
||||
String id2 = myPatientDao.create(p).getId().toUnqualifiedVersionless().getValue();
|
||||
|
||||
SearchParameterMap map;
|
||||
List<String> found;
|
||||
|
||||
map = new SearchParameterMap();
|
||||
map.setLoadSynchronous(true);
|
||||
map.add(Constants.PARAM_FILTER, new StringParam("name co smi"));
|
||||
found = toUnqualifiedVersionlessIdValues(myPatientDao.search(map));
|
||||
assertThat(found, containsInAnyOrder(id1));
|
||||
|
||||
map = new SearchParameterMap();
|
||||
map.setLoadSynchronous(true);
|
||||
map.add(Constants.PARAM_FILTER, new StringParam("name co smith"));
|
||||
found = toUnqualifiedVersionlessIdValues(myPatientDao.search(map));
|
||||
assertThat(found, containsInAnyOrder(id1));
|
||||
|
||||
map = new SearchParameterMap();
|
||||
map.setLoadSynchronous(true);
|
||||
map.add(Constants.PARAM_FILTER, new StringParam("given co frank"));
|
||||
found = toUnqualifiedVersionlessIdValues(myPatientDao.search(map));
|
||||
assertThat(found, containsInAnyOrder(id2));
|
||||
|
||||
map = new SearchParameterMap();
|
||||
map.setLoadSynchronous(true);
|
||||
map.add(Constants.PARAM_FILTER, new StringParam("family co jones"));
|
||||
found = toUnqualifiedVersionlessIdValues(myPatientDao.search(map));
|
||||
assertThat(found, containsInAnyOrder(id2));
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testStringComparatorSw() {
|
||||
|
||||
Patient p = new Patient();
|
||||
p.addName().setFamily("Smith").addGiven("John");
|
||||
p.setActive(true);
|
||||
String id1 = myPatientDao.create(p).getId().toUnqualifiedVersionless().getValue();
|
||||
|
||||
p = new Patient();
|
||||
p.addName().setFamily("Jones").addGiven("Frank");
|
||||
p.setActive(false);
|
||||
String id2 = myPatientDao.create(p).getId().toUnqualifiedVersionless().getValue();
|
||||
|
||||
SearchParameterMap map;
|
||||
List<String> found;
|
||||
|
||||
map = new SearchParameterMap();
|
||||
map.setLoadSynchronous(true);
|
||||
map.add(Constants.PARAM_FILTER, new StringParam("name sw smi"));
|
||||
found = toUnqualifiedVersionlessIdValues(myPatientDao.search(map));
|
||||
assertThat(found, containsInAnyOrder(id1));
|
||||
|
||||
map = new SearchParameterMap();
|
||||
map.setLoadSynchronous(true);
|
||||
map.add(Constants.PARAM_FILTER, new StringParam("name sw mi"));
|
||||
found = toUnqualifiedVersionlessIdValues(myPatientDao.search(map));
|
||||
assertThat(found, Matchers.empty());
|
||||
|
||||
map = new SearchParameterMap();
|
||||
map.setLoadSynchronous(true);
|
||||
map.add(Constants.PARAM_FILTER, new StringParam("given sw fr"));
|
||||
found = toUnqualifiedVersionlessIdValues(myPatientDao.search(map));
|
||||
assertThat(found, containsInAnyOrder(id2));
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testStringComparatorEw() {
|
||||
|
||||
Patient p = new Patient();
|
||||
p.addName().setFamily("Smith").addGiven("John");
|
||||
p.setActive(true);
|
||||
String id1 = myPatientDao.create(p).getId().toUnqualifiedVersionless().getValue();
|
||||
|
||||
p = new Patient();
|
||||
p.addName().setFamily("Jones").addGiven("Frank");
|
||||
p.setActive(false);
|
||||
String id2 = myPatientDao.create(p).getId().toUnqualifiedVersionless().getValue();
|
||||
|
||||
SearchParameterMap map;
|
||||
List<String> found;
|
||||
|
||||
map = new SearchParameterMap();
|
||||
map.setLoadSynchronous(true);
|
||||
map.add(Constants.PARAM_FILTER, new StringParam("family ew ith"));
|
||||
found = toUnqualifiedVersionlessIdValues(myPatientDao.search(map));
|
||||
assertThat(found, containsInAnyOrder(id1));
|
||||
|
||||
map = new SearchParameterMap();
|
||||
map.setLoadSynchronous(true);
|
||||
map.add(Constants.PARAM_FILTER, new StringParam("name ew it"));
|
||||
found = toUnqualifiedVersionlessIdValues(myPatientDao.search(map));
|
||||
assertThat(found, Matchers.empty());
|
||||
|
||||
map = new SearchParameterMap();
|
||||
map.setLoadSynchronous(true);
|
||||
map.add(Constants.PARAM_FILTER, new StringParam("given ew nk"));
|
||||
found = toUnqualifiedVersionlessIdValues(myPatientDao.search(map));
|
||||
assertThat(found, containsInAnyOrder(id2));
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testStringComparatorGt() {
|
||||
|
||||
Patient p = new Patient();
|
||||
p.addName().setFamily("Smith").addGiven("John");
|
||||
p.setActive(true);
|
||||
String id1 = myPatientDao.create(p).getId().toUnqualifiedVersionless().getValue();
|
||||
|
||||
p = new Patient();
|
||||
p.addName().setFamily("Jones").addGiven("Frank");
|
||||
p.setActive(false);
|
||||
String id2 = myPatientDao.create(p).getId().toUnqualifiedVersionless().getValue();
|
||||
|
||||
SearchParameterMap map;
|
||||
List<String> found;
|
||||
|
||||
map = new SearchParameterMap();
|
||||
map.setLoadSynchronous(true);
|
||||
map.add(Constants.PARAM_FILTER, new StringParam("family gt jones"));
|
||||
found = toUnqualifiedVersionlessIdValues(myPatientDao.search(map));
|
||||
assertThat(found, containsInAnyOrder(id1));
|
||||
|
||||
map = new SearchParameterMap();
|
||||
map.setLoadSynchronous(true);
|
||||
map.add(Constants.PARAM_FILTER, new StringParam("family gt arthur"));
|
||||
found = toUnqualifiedVersionlessIdValues(myPatientDao.search(map));
|
||||
assertThat(found, containsInAnyOrder(id1, id2));
|
||||
|
||||
map = new SearchParameterMap();
|
||||
map.setLoadSynchronous(true);
|
||||
map.add(Constants.PARAM_FILTER, new StringParam("given gt john"));
|
||||
found = toUnqualifiedVersionlessIdValues(myPatientDao.search(map));
|
||||
assertThat(found, Matchers.empty());
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testStringComparatorLt() {
|
||||
|
||||
Patient p = new Patient();
|
||||
p.addName().setFamily("Smith").addGiven("John");
|
||||
p.setActive(true);
|
||||
String id1 = myPatientDao.create(p).getId().toUnqualifiedVersionless().getValue();
|
||||
|
||||
p = new Patient();
|
||||
p.addName().setFamily("Jones").addGiven("Frank");
|
||||
p.setActive(false);
|
||||
String id2 = myPatientDao.create(p).getId().toUnqualifiedVersionless().getValue();
|
||||
|
||||
SearchParameterMap map;
|
||||
List<String> found;
|
||||
|
||||
map = new SearchParameterMap();
|
||||
map.setLoadSynchronous(true);
|
||||
map.add(Constants.PARAM_FILTER, new StringParam("family lt smith"));
|
||||
found = toUnqualifiedVersionlessIdValues(myPatientDao.search(map));
|
||||
assertThat(found, containsInAnyOrder(id2));
|
||||
|
||||
map = new SearchParameterMap();
|
||||
map.setLoadSynchronous(true);
|
||||
map.add(Constants.PARAM_FILTER, new StringParam("family lt walker"));
|
||||
found = toUnqualifiedVersionlessIdValues(myPatientDao.search(map));
|
||||
assertThat(found, containsInAnyOrder(id1, id2));
|
||||
|
||||
map = new SearchParameterMap();
|
||||
map.setLoadSynchronous(true);
|
||||
map.add(Constants.PARAM_FILTER, new StringParam("given lt frank"));
|
||||
found = toUnqualifiedVersionlessIdValues(myPatientDao.search(map));
|
||||
assertThat(found, Matchers.empty());
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testStringComparatorGe() {
|
||||
|
||||
Patient p = new Patient();
|
||||
p.addName().setFamily("Smith").addGiven("John");
|
||||
p.setActive(true);
|
||||
String id1 = myPatientDao.create(p).getId().toUnqualifiedVersionless().getValue();
|
||||
|
||||
p = new Patient();
|
||||
p.addName().setFamily("Jones").addGiven("Frank");
|
||||
p.setActive(false);
|
||||
String id2 = myPatientDao.create(p).getId().toUnqualifiedVersionless().getValue();
|
||||
|
||||
SearchParameterMap map;
|
||||
List<String> found;
|
||||
|
||||
map = new SearchParameterMap();
|
||||
map.setLoadSynchronous(true);
|
||||
map.add(Constants.PARAM_FILTER, new StringParam("family ge jones"));
|
||||
found = toUnqualifiedVersionlessIdValues(myPatientDao.search(map));
|
||||
assertThat(found, containsInAnyOrder(id1, id2));
|
||||
|
||||
map = new SearchParameterMap();
|
||||
map.setLoadSynchronous(true);
|
||||
map.add(Constants.PARAM_FILTER, new StringParam("family ge justin"));
|
||||
found = toUnqualifiedVersionlessIdValues(myPatientDao.search(map));
|
||||
assertThat(found, containsInAnyOrder(id1));
|
||||
|
||||
map = new SearchParameterMap();
|
||||
map.setLoadSynchronous(true);
|
||||
map.add(Constants.PARAM_FILTER, new StringParam("family ge arthur"));
|
||||
found = toUnqualifiedVersionlessIdValues(myPatientDao.search(map));
|
||||
assertThat(found, containsInAnyOrder(id1, id2));
|
||||
|
||||
map = new SearchParameterMap();
|
||||
map.setLoadSynchronous(true);
|
||||
map.add(Constants.PARAM_FILTER, new StringParam("given ge jon"));
|
||||
found = toUnqualifiedVersionlessIdValues(myPatientDao.search(map));
|
||||
assertThat(found, Matchers.empty());
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testStringComparatorLe() {
|
||||
|
||||
Patient p = new Patient();
|
||||
p.addName().setFamily("Smith").addGiven("John");
|
||||
p.setActive(true);
|
||||
String id1 = myPatientDao.create(p).getId().toUnqualifiedVersionless().getValue();
|
||||
|
||||
p = new Patient();
|
||||
p.addName().setFamily("Jones").addGiven("Frank");
|
||||
p.setActive(false);
|
||||
String id2 = myPatientDao.create(p).getId().toUnqualifiedVersionless().getValue();
|
||||
|
||||
SearchParameterMap map;
|
||||
List<String> found;
|
||||
|
||||
map = new SearchParameterMap();
|
||||
map.setLoadSynchronous(true);
|
||||
map.add(Constants.PARAM_FILTER, new StringParam("family le smith"));
|
||||
found = toUnqualifiedVersionlessIdValues(myPatientDao.search(map));
|
||||
assertThat(found, containsInAnyOrder(id1, id2));
|
||||
|
||||
map = new SearchParameterMap();
|
||||
map.setLoadSynchronous(true);
|
||||
map.add(Constants.PARAM_FILTER, new StringParam("family le jones"));
|
||||
found = toUnqualifiedVersionlessIdValues(myPatientDao.search(map));
|
||||
assertThat(found, containsInAnyOrder(id2));
|
||||
|
||||
map = new SearchParameterMap();
|
||||
map.setLoadSynchronous(true);
|
||||
map.add(Constants.PARAM_FILTER, new StringParam("family le jackson"));
|
||||
found = toUnqualifiedVersionlessIdValues(myPatientDao.search(map));
|
||||
assertThat(found, Matchers.empty());
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDateComparatorEq() {
|
||||
|
||||
Patient p = new Patient();
|
||||
p.addName().setFamily("Smith").addGiven("John");
|
||||
p.setBirthDateElement(new DateType("1955-01-01"));
|
||||
p.setActive(true);
|
||||
String id1 = myPatientDao.create(p).getId().toUnqualifiedVersionless().getValue();
|
||||
|
||||
SearchParameterMap map;
|
||||
List<String> found;
|
||||
|
||||
map = new SearchParameterMap();
|
||||
map.setLoadSynchronous(true);
|
||||
map.add(Constants.PARAM_FILTER, new StringParam("birthdate eq 1955-01-01"));
|
||||
found = toUnqualifiedVersionlessIdValues(myPatientDao.search(map));
|
||||
assertThat(found, containsInAnyOrder(id1));
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDateComparatorNe() {
|
||||
|
||||
Patient p = new Patient();
|
||||
p.addName().setFamily("Smith").addGiven("John");
|
||||
p.setBirthDateElement(new DateType("1955-01-01"));
|
||||
p.setActive(true);
|
||||
String id1 = myPatientDao.create(p).getId().toUnqualifiedVersionless().getValue();
|
||||
|
||||
SearchParameterMap map;
|
||||
List<String> found;
|
||||
|
||||
map = new SearchParameterMap();
|
||||
map.setLoadSynchronous(true);
|
||||
map.add(Constants.PARAM_FILTER, new StringParam("birthdate ne 1955-01-01"));
|
||||
found = toUnqualifiedVersionlessIdValues(myPatientDao.search(map));
|
||||
assertThat(found, Matchers.empty());
|
||||
|
||||
map = new SearchParameterMap();
|
||||
map.setLoadSynchronous(true);
|
||||
map.add(Constants.PARAM_FILTER, new StringParam("birthdate ne 1995-01-01"));
|
||||
found = toUnqualifiedVersionlessIdValues(myPatientDao.search(map));
|
||||
assertThat(found, containsInAnyOrder(id1));
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDateComparatorGt() {
|
||||
|
||||
Patient p = new Patient();
|
||||
p.addName().setFamily("Smith").addGiven("John");
|
||||
p.setBirthDateElement(new DateType("1955-01-01"));
|
||||
p.setActive(true);
|
||||
String id1 = myPatientDao.create(p).getId().toUnqualifiedVersionless().getValue();
|
||||
|
||||
SearchParameterMap map;
|
||||
List<String> found;
|
||||
|
||||
map = new SearchParameterMap();
|
||||
map.setLoadSynchronous(true);
|
||||
map.add(Constants.PARAM_FILTER, new StringParam("birthdate gt 1954-12-31"));
|
||||
found = toUnqualifiedVersionlessIdValues(myPatientDao.search(map));
|
||||
assertThat(found, containsInAnyOrder(id1));
|
||||
|
||||
map = new SearchParameterMap();
|
||||
map.setLoadSynchronous(true);
|
||||
map.add(Constants.PARAM_FILTER, new StringParam("birthdate gt 1955-01-01"));
|
||||
found = toUnqualifiedVersionlessIdValues(myPatientDao.search(map));
|
||||
assertThat(found, Matchers.empty());
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDateComparatorLt() {
|
||||
|
||||
Patient p = new Patient();
|
||||
p.addName().setFamily("Smith").addGiven("John");
|
||||
p.setBirthDateElement(new DateType("1955-01-01"));
|
||||
p.setActive(true);
|
||||
String id1 = myPatientDao.create(p).getId().toUnqualifiedVersionless().getValue();
|
||||
|
||||
SearchParameterMap map;
|
||||
List<String> found;
|
||||
|
||||
map = new SearchParameterMap();
|
||||
map.setLoadSynchronous(true);
|
||||
map.add(Constants.PARAM_FILTER, new StringParam("birthdate lt 1955-01-02"));
|
||||
found = toUnqualifiedVersionlessIdValues(myPatientDao.search(map));
|
||||
assertThat(found, containsInAnyOrder(id1));
|
||||
|
||||
map = new SearchParameterMap();
|
||||
map.setLoadSynchronous(true);
|
||||
map.add(Constants.PARAM_FILTER, new StringParam("birthdate lt 1955-01-01"));
|
||||
found = toUnqualifiedVersionlessIdValues(myPatientDao.search(map));
|
||||
assertThat(found, Matchers.empty());
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDateComparatorGe() {
|
||||
|
||||
Patient p = new Patient();
|
||||
p.addName().setFamily("Smith").addGiven("John");
|
||||
p.setBirthDateElement(new DateType("1955-01-01"));
|
||||
p.setActive(true);
|
||||
String id1 = myPatientDao.create(p).getId().toUnqualifiedVersionless().getValue();
|
||||
|
||||
SearchParameterMap map;
|
||||
List<String> found;
|
||||
|
||||
map = new SearchParameterMap();
|
||||
map.setLoadSynchronous(true);
|
||||
map.add(Constants.PARAM_FILTER, new StringParam("birthdate ge 1955-01-01"));
|
||||
found = toUnqualifiedVersionlessIdValues(myPatientDao.search(map));
|
||||
assertThat(found, containsInAnyOrder(id1));
|
||||
|
||||
map = new SearchParameterMap();
|
||||
map.setLoadSynchronous(true);
|
||||
map.add(Constants.PARAM_FILTER, new StringParam("birthdate ge 1954-12-31"));
|
||||
found = toUnqualifiedVersionlessIdValues(myPatientDao.search(map));
|
||||
assertThat(found, containsInAnyOrder(id1));
|
||||
|
||||
map = new SearchParameterMap();
|
||||
map.setLoadSynchronous(true);
|
||||
map.add(Constants.PARAM_FILTER, new StringParam("birthdate ge 1955-01-02"));
|
||||
found = toUnqualifiedVersionlessIdValues(myPatientDao.search(map));
|
||||
assertThat(found, Matchers.empty());
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDateComparatorLe() {
|
||||
|
||||
Patient p = new Patient();
|
||||
p.addName().setFamily("Smith").addGiven("John");
|
||||
p.setBirthDateElement(new DateType("1955-01-01"));
|
||||
p.setActive(true);
|
||||
String id1 = myPatientDao.create(p).getId().toUnqualifiedVersionless().getValue();
|
||||
|
||||
SearchParameterMap map;
|
||||
List<String> found;
|
||||
|
||||
map = new SearchParameterMap();
|
||||
map.setLoadSynchronous(true);
|
||||
map.add(Constants.PARAM_FILTER, new StringParam("birthdate le 1955-01-01"));
|
||||
found = toUnqualifiedVersionlessIdValues(myPatientDao.search(map));
|
||||
assertThat(found, containsInAnyOrder(id1));
|
||||
|
||||
map = new SearchParameterMap();
|
||||
map.setLoadSynchronous(true);
|
||||
map.add(Constants.PARAM_FILTER, new StringParam("birthdate le 1954-12-31"));
|
||||
found = toUnqualifiedVersionlessIdValues(myPatientDao.search(map));
|
||||
assertThat(found, Matchers.empty());
|
||||
|
||||
map = new SearchParameterMap();
|
||||
map.setLoadSynchronous(true);
|
||||
map.add(Constants.PARAM_FILTER, new StringParam("birthdate le 1955-01-02"));
|
||||
found = toUnqualifiedVersionlessIdValues(myPatientDao.search(map));
|
||||
assertThat(found, containsInAnyOrder(id1));
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNumericComparatorEq() {
|
||||
|
||||
RiskAssessment ra1 = new RiskAssessment();
|
||||
RiskAssessment ra2 = new RiskAssessment();
|
||||
|
||||
RiskAssessment.RiskAssessmentPredictionComponent component = new RiskAssessment.RiskAssessmentPredictionComponent();
|
||||
DecimalType doseNumber = new DecimalType(0.25);
|
||||
component.setProbability(doseNumber);
|
||||
ra1.addPrediction(component);
|
||||
String raId1 = myRiskAssessmentDao.create(ra1).getId().toUnqualifiedVersionless().getValue();
|
||||
|
||||
component = new RiskAssessment.RiskAssessmentPredictionComponent();
|
||||
doseNumber = new DecimalType(0.3);
|
||||
component.setProbability(doseNumber);
|
||||
ra2.addPrediction(component);
|
||||
String raId2 = myRiskAssessmentDao.create(ra2).getId().toUnqualifiedVersionless().getValue();
|
||||
|
||||
SearchParameterMap map;
|
||||
List<String> found;
|
||||
|
||||
map = new SearchParameterMap();
|
||||
map.setLoadSynchronous(true);
|
||||
map.add(Constants.PARAM_FILTER, new StringParam("probability eq 0.25"));
|
||||
found = toUnqualifiedVersionlessIdValues(myRiskAssessmentDao.search(map));
|
||||
assertThat(found, containsInAnyOrder(raId1));
|
||||
|
||||
map = new SearchParameterMap();
|
||||
map.setLoadSynchronous(true);
|
||||
map.add(Constants.PARAM_FILTER, new StringParam("probability eq 0.3"));
|
||||
found = toUnqualifiedVersionlessIdValues(myRiskAssessmentDao.search(map));
|
||||
assertThat(found, containsInAnyOrder(raId2));
|
||||
|
||||
map = new SearchParameterMap();
|
||||
map.setLoadSynchronous(true);
|
||||
map.add(Constants.PARAM_FILTER, new StringParam("probability eq 0.1"));
|
||||
found = toUnqualifiedVersionlessIdValues(myRiskAssessmentDao.search(map));
|
||||
assertThat(found, Matchers.empty());
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNumericComparatorNe() {
|
||||
|
||||
RiskAssessment ra1 = new RiskAssessment();
|
||||
RiskAssessment ra2 = new RiskAssessment();
|
||||
|
||||
RiskAssessment.RiskAssessmentPredictionComponent component = new RiskAssessment.RiskAssessmentPredictionComponent();
|
||||
DecimalType doseNumber = new DecimalType(0.25);
|
||||
component.setProbability(doseNumber);
|
||||
ra1.addPrediction(component);
|
||||
String raId1 = myRiskAssessmentDao.create(ra1).getId().toUnqualifiedVersionless().getValue();
|
||||
|
||||
component = new RiskAssessment.RiskAssessmentPredictionComponent();
|
||||
doseNumber = new DecimalType(0.3);
|
||||
component.setProbability(doseNumber);
|
||||
ra2.addPrediction(component);
|
||||
String raId2 = myRiskAssessmentDao.create(ra2).getId().toUnqualifiedVersionless().getValue();
|
||||
|
||||
SearchParameterMap map;
|
||||
List<String> found;
|
||||
|
||||
map = new SearchParameterMap();
|
||||
map.setLoadSynchronous(true);
|
||||
map.add(Constants.PARAM_FILTER, new StringParam("probability ne 0.25"));
|
||||
found = toUnqualifiedVersionlessIdValues(myRiskAssessmentDao.search(map));
|
||||
assertThat(found, containsInAnyOrder(raId2));
|
||||
|
||||
map = new SearchParameterMap();
|
||||
map.setLoadSynchronous(true);
|
||||
map.add(Constants.PARAM_FILTER, new StringParam("probability ne 0.3"));
|
||||
found = toUnqualifiedVersionlessIdValues(myRiskAssessmentDao.search(map));
|
||||
assertThat(found, containsInAnyOrder(raId1));
|
||||
|
||||
map = new SearchParameterMap();
|
||||
map.setLoadSynchronous(true);
|
||||
map.add(Constants.PARAM_FILTER, new StringParam("probability ne 0.1"));
|
||||
found = toUnqualifiedVersionlessIdValues(myRiskAssessmentDao.search(map));
|
||||
assertThat(found, containsInAnyOrder(raId1, raId2));
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNumericComparatorGt() {
|
||||
|
||||
RiskAssessment ra1 = new RiskAssessment();
|
||||
RiskAssessment ra2 = new RiskAssessment();
|
||||
|
||||
RiskAssessment.RiskAssessmentPredictionComponent component = new RiskAssessment.RiskAssessmentPredictionComponent();
|
||||
DecimalType doseNumber = new DecimalType(0.25);
|
||||
component.setProbability(doseNumber);
|
||||
ra1.addPrediction(component);
|
||||
String raId1 = myRiskAssessmentDao.create(ra1).getId().toUnqualifiedVersionless().getValue();
|
||||
|
||||
component = new RiskAssessment.RiskAssessmentPredictionComponent();
|
||||
doseNumber = new DecimalType(0.3);
|
||||
component.setProbability(doseNumber);
|
||||
ra2.addPrediction(component);
|
||||
String raId2 = myRiskAssessmentDao.create(ra2).getId().toUnqualifiedVersionless().getValue();
|
||||
|
||||
SearchParameterMap map;
|
||||
List<String> found;
|
||||
|
||||
map = new SearchParameterMap();
|
||||
map.setLoadSynchronous(true);
|
||||
map.add(Constants.PARAM_FILTER, new StringParam("probability gt 0.25"));
|
||||
found = toUnqualifiedVersionlessIdValues(myRiskAssessmentDao.search(map));
|
||||
assertThat(found, containsInAnyOrder(raId2));
|
||||
|
||||
map = new SearchParameterMap();
|
||||
map.setLoadSynchronous(true);
|
||||
map.add(Constants.PARAM_FILTER, new StringParam("probability gt 0.3"));
|
||||
found = toUnqualifiedVersionlessIdValues(myRiskAssessmentDao.search(map));
|
||||
assertThat(found, Matchers.empty());
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNumericComparatorLt() {
|
||||
|
||||
RiskAssessment ra1 = new RiskAssessment();
|
||||
RiskAssessment ra2 = new RiskAssessment();
|
||||
|
||||
RiskAssessment.RiskAssessmentPredictionComponent component = new RiskAssessment.RiskAssessmentPredictionComponent();
|
||||
DecimalType doseNumber = new DecimalType(0.25);
|
||||
component.setProbability(doseNumber);
|
||||
ra1.addPrediction(component);
|
||||
String raId1 = myRiskAssessmentDao.create(ra1).getId().toUnqualifiedVersionless().getValue();
|
||||
|
||||
component = new RiskAssessment.RiskAssessmentPredictionComponent();
|
||||
doseNumber = new DecimalType(0.3);
|
||||
component.setProbability(doseNumber);
|
||||
ra2.addPrediction(component);
|
||||
String raId2 = myRiskAssessmentDao.create(ra2).getId().toUnqualifiedVersionless().getValue();
|
||||
|
||||
SearchParameterMap map;
|
||||
List<String> found;
|
||||
|
||||
map = new SearchParameterMap();
|
||||
map.setLoadSynchronous(true);
|
||||
map.add(Constants.PARAM_FILTER, new StringParam("probability lt 0.3"));
|
||||
found = toUnqualifiedVersionlessIdValues(myRiskAssessmentDao.search(map));
|
||||
assertThat(found, containsInAnyOrder(raId1));
|
||||
|
||||
map = new SearchParameterMap();
|
||||
map.setLoadSynchronous(true);
|
||||
map.add(Constants.PARAM_FILTER, new StringParam("probability lt 0.25"));
|
||||
found = toUnqualifiedVersionlessIdValues(myRiskAssessmentDao.search(map));
|
||||
assertThat(found, Matchers.empty());
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNumericComparatorGe() {
|
||||
|
||||
RiskAssessment ra1 = new RiskAssessment();
|
||||
RiskAssessment ra2 = new RiskAssessment();
|
||||
|
||||
RiskAssessment.RiskAssessmentPredictionComponent component = new RiskAssessment.RiskAssessmentPredictionComponent();
|
||||
DecimalType doseNumber = new DecimalType(0.25);
|
||||
component.setProbability(doseNumber);
|
||||
ra1.addPrediction(component);
|
||||
String raId1 = myRiskAssessmentDao.create(ra1).getId().toUnqualifiedVersionless().getValue();
|
||||
|
||||
component = new RiskAssessment.RiskAssessmentPredictionComponent();
|
||||
doseNumber = new DecimalType(0.3);
|
||||
component.setProbability(doseNumber);
|
||||
ra2.addPrediction(component);
|
||||
String raId2 = myRiskAssessmentDao.create(ra2).getId().toUnqualifiedVersionless().getValue();
|
||||
|
||||
SearchParameterMap map;
|
||||
List<String> found;
|
||||
|
||||
map = new SearchParameterMap();
|
||||
map.setLoadSynchronous(true);
|
||||
map.add(Constants.PARAM_FILTER, new StringParam("probability ge 0.25"));
|
||||
found = toUnqualifiedVersionlessIdValues(myRiskAssessmentDao.search(map));
|
||||
assertThat(found, containsInAnyOrder(raId1, raId2));
|
||||
|
||||
map = new SearchParameterMap();
|
||||
map.setLoadSynchronous(true);
|
||||
map.add(Constants.PARAM_FILTER, new StringParam("probability ge 0.3"));
|
||||
found = toUnqualifiedVersionlessIdValues(myRiskAssessmentDao.search(map));
|
||||
assertThat(found, containsInAnyOrder(raId2));
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNumericComparatorLe() {
|
||||
|
||||
RiskAssessment ra1 = new RiskAssessment();
|
||||
RiskAssessment ra2 = new RiskAssessment();
|
||||
|
||||
RiskAssessment.RiskAssessmentPredictionComponent component = new RiskAssessment.RiskAssessmentPredictionComponent();
|
||||
DecimalType doseNumber = new DecimalType(0.25);
|
||||
component.setProbability(doseNumber);
|
||||
ra1.addPrediction(component);
|
||||
String raId1 = myRiskAssessmentDao.create(ra1).getId().toUnqualifiedVersionless().getValue();
|
||||
|
||||
component = new RiskAssessment.RiskAssessmentPredictionComponent();
|
||||
doseNumber = new DecimalType(0.3);
|
||||
component.setProbability(doseNumber);
|
||||
ra2.addPrediction(component);
|
||||
String raId2 = myRiskAssessmentDao.create(ra2).getId().toUnqualifiedVersionless().getValue();
|
||||
|
||||
SearchParameterMap map;
|
||||
List<String> found;
|
||||
|
||||
map = new SearchParameterMap();
|
||||
map.setLoadSynchronous(true);
|
||||
map.add(Constants.PARAM_FILTER, new StringParam("probability le 0.25"));
|
||||
found = toUnqualifiedVersionlessIdValues(myRiskAssessmentDao.search(map));
|
||||
assertThat(found, containsInAnyOrder(raId1));
|
||||
|
||||
map = new SearchParameterMap();
|
||||
map.setLoadSynchronous(true);
|
||||
map.add(Constants.PARAM_FILTER, new StringParam("probability le 0.3"));
|
||||
found = toUnqualifiedVersionlessIdValues(myRiskAssessmentDao.search(map));
|
||||
assertThat(found, containsInAnyOrder(raId1, raId2));
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSearchUriEq() throws Exception {
|
||||
|
||||
ValueSet vs1 = new ValueSet();
|
||||
vs1.setUrl("http://hl7.org/foo/baz");
|
||||
IIdType vsId1 = myValueSetDao.create(vs1, mySrd).getId().toUnqualifiedVersionless();
|
||||
|
||||
ValueSet vs2 = new ValueSet();
|
||||
vs2.setUrl("http://hl7.org/foo/bar");
|
||||
IIdType vsId2 = myValueSetDao.create(vs2, mySrd).getId().toUnqualifiedVersionless();
|
||||
|
||||
IBundleProvider result;
|
||||
result = myValueSetDao.search(new SearchParameterMap().setLoadSynchronous(true).add(Constants.PARAM_FILTER,
|
||||
new StringParam("url eq http://hl7.org/foo/baz")));
|
||||
assertThat(toUnqualifiedVersionlessIds(result), containsInAnyOrder(vsId1));
|
||||
|
||||
result = myValueSetDao.search(new SearchParameterMap().setLoadSynchronous(true).add(Constants.PARAM_FILTER,
|
||||
new StringParam("url eq http://hl7.org/foo/bar")));
|
||||
assertThat(toUnqualifiedVersionlessIds(result), containsInAnyOrder(vsId2));
|
||||
|
||||
result = myValueSetDao.search(new SearchParameterMap().setLoadSynchronous(true).add(Constants.PARAM_FILTER,
|
||||
new StringParam("url eq http://hl7.org/foo/bar/bar")));
|
||||
assertThat(toUnqualifiedVersionlessIds(result), Matchers.empty());
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSearchUriNe() throws Exception {
|
||||
|
||||
ValueSet vs1 = new ValueSet();
|
||||
vs1.setUrl("http://hl7.org/foo/baz");
|
||||
IIdType vsId1 = myValueSetDao.create(vs1, mySrd).getId().toUnqualifiedVersionless();
|
||||
|
||||
ValueSet vs2 = new ValueSet();
|
||||
vs2.setUrl("http://hl7.org/foo/bar");
|
||||
IIdType vsId2 = myValueSetDao.create(vs2, mySrd).getId().toUnqualifiedVersionless();
|
||||
|
||||
IBundleProvider result;
|
||||
result = myValueSetDao.search(new SearchParameterMap().setLoadSynchronous(true).add(Constants.PARAM_FILTER,
|
||||
new StringParam("url ne http://hl7.org/foo/baz")));
|
||||
assertThat(toUnqualifiedVersionlessIds(result), containsInAnyOrder(vsId2));
|
||||
|
||||
result = myValueSetDao.search(new SearchParameterMap().setLoadSynchronous(true).add(Constants.PARAM_FILTER,
|
||||
new StringParam("url ne http://hl7.org/foo/bar")));
|
||||
assertThat(toUnqualifiedVersionlessIds(result), containsInAnyOrder(vsId1));
|
||||
|
||||
result = myValueSetDao.search(new SearchParameterMap().setLoadSynchronous(true).add(Constants.PARAM_FILTER,
|
||||
new StringParam("url ne http://hl7.org/foo/baz and url ne http://hl7.org/foo/bar")));
|
||||
assertThat(toUnqualifiedVersionlessIds(result), Matchers.empty());
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSearchUriCo() throws Exception {
|
||||
|
||||
ValueSet vs1 = new ValueSet();
|
||||
vs1.setUrl("http://hl7.org/foo/baz");
|
||||
IIdType vsId1 = myValueSetDao.create(vs1, mySrd).getId().toUnqualifiedVersionless();
|
||||
|
||||
ValueSet vs2 = new ValueSet();
|
||||
vs2.setUrl("http://hl7.org/foo/bar");
|
||||
IIdType vsId2 = myValueSetDao.create(vs2, mySrd).getId().toUnqualifiedVersionless();
|
||||
|
||||
IBundleProvider result;
|
||||
result = myValueSetDao.search(new SearchParameterMap().setLoadSynchronous(true).add(Constants.PARAM_FILTER,
|
||||
new StringParam("url co http://hl7.org/foo")));
|
||||
assertThat(toUnqualifiedVersionlessIds(result), containsInAnyOrder(vsId1, vsId2));
|
||||
|
||||
result = myValueSetDao.search(new SearchParameterMap().setLoadSynchronous(true).add(Constants.PARAM_FILTER,
|
||||
new StringParam("url co baz")));
|
||||
assertThat(toUnqualifiedVersionlessIds(result), containsInAnyOrder(vsId1));
|
||||
|
||||
result = myValueSetDao.search(new SearchParameterMap().setLoadSynchronous(true).add(Constants.PARAM_FILTER,
|
||||
new StringParam("url co http://hl7.org/foo/bat")));
|
||||
assertThat(toUnqualifiedVersionlessIds(result), Matchers.empty());
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSearchUriGt() throws Exception {
|
||||
|
||||
ValueSet vs1 = new ValueSet();
|
||||
vs1.setUrl("http://hl7.org/foo/baz");
|
||||
IIdType vsId1 = myValueSetDao.create(vs1, mySrd).getId().toUnqualifiedVersionless();
|
||||
|
||||
ValueSet vs2 = new ValueSet();
|
||||
vs2.setUrl("http://hl7.org/foo/bar");
|
||||
IIdType vsId2 = myValueSetDao.create(vs2, mySrd).getId().toUnqualifiedVersionless();
|
||||
|
||||
IBundleProvider result;
|
||||
result = myValueSetDao.search(new SearchParameterMap().setLoadSynchronous(true).add(Constants.PARAM_FILTER,
|
||||
new StringParam("url gt http://hl7.org/foo")));
|
||||
assertThat(toUnqualifiedVersionlessIds(result), containsInAnyOrder(vsId1, vsId2));
|
||||
|
||||
result = myValueSetDao.search(new SearchParameterMap().setLoadSynchronous(true).add(Constants.PARAM_FILTER,
|
||||
new StringParam("url gt http://hl7.org/foo/bar")));
|
||||
assertThat(toUnqualifiedVersionlessIds(result), containsInAnyOrder(vsId1));
|
||||
|
||||
result = myValueSetDao.search(new SearchParameterMap().setLoadSynchronous(true).add(Constants.PARAM_FILTER,
|
||||
new StringParam("url gt http://hl7.org/foo/baza")));
|
||||
assertThat(toUnqualifiedVersionlessIds(result), Matchers.empty());
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSearchUriLt() throws Exception {
|
||||
|
||||
ValueSet vs1 = new ValueSet();
|
||||
vs1.setUrl("http://hl7.org/foo/baz");
|
||||
IIdType vsId1 = myValueSetDao.create(vs1, mySrd).getId().toUnqualifiedVersionless();
|
||||
|
||||
ValueSet vs2 = new ValueSet();
|
||||
vs2.setUrl("http://hl7.org/foo/bar");
|
||||
IIdType vsId2 = myValueSetDao.create(vs2, mySrd).getId().toUnqualifiedVersionless();
|
||||
|
||||
IBundleProvider result;
|
||||
result = myValueSetDao.search(new SearchParameterMap().setLoadSynchronous(true).add(Constants.PARAM_FILTER,
|
||||
new StringParam("url lt http://hl7.org/foo")));
|
||||
assertThat(toUnqualifiedVersionlessIds(result), Matchers.empty());
|
||||
|
||||
result = myValueSetDao.search(new SearchParameterMap().setLoadSynchronous(true).add(Constants.PARAM_FILTER,
|
||||
new StringParam("url lt http://hl7.org/foo/baz")));
|
||||
assertThat(toUnqualifiedVersionlessIds(result), containsInAnyOrder(vsId2));
|
||||
|
||||
result = myValueSetDao.search(new SearchParameterMap().setLoadSynchronous(true).add(Constants.PARAM_FILTER,
|
||||
new StringParam("url lt http://hl7.org/foo/bara")));
|
||||
assertThat(toUnqualifiedVersionlessIds(result), containsInAnyOrder(vsId2));
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSearchUriGe() throws Exception {
|
||||
|
||||
ValueSet vs1 = new ValueSet();
|
||||
vs1.setUrl("http://hl7.org/foo/baz");
|
||||
IIdType vsId1 = myValueSetDao.create(vs1, mySrd).getId().toUnqualifiedVersionless();
|
||||
|
||||
ValueSet vs2 = new ValueSet();
|
||||
vs2.setUrl("http://hl7.org/foo/bar");
|
||||
IIdType vsId2 = myValueSetDao.create(vs2, mySrd).getId().toUnqualifiedVersionless();
|
||||
|
||||
IBundleProvider result;
|
||||
result = myValueSetDao.search(new SearchParameterMap().setLoadSynchronous(true).add(Constants.PARAM_FILTER,
|
||||
new StringParam("url ge http://hl7.org/foo/bar")));
|
||||
assertThat(toUnqualifiedVersionlessIds(result), containsInAnyOrder(vsId1, vsId2));
|
||||
|
||||
result = myValueSetDao.search(new SearchParameterMap().setLoadSynchronous(true).add(Constants.PARAM_FILTER,
|
||||
new StringParam("url ge http://hl7.org/foo/baza")));
|
||||
assertThat(toUnqualifiedVersionlessIds(result), Matchers.empty());
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSearchUriLe() throws Exception {
|
||||
|
||||
ValueSet vs1 = new ValueSet();
|
||||
vs1.setUrl("http://hl7.org/foo/baz");
|
||||
IIdType vsId1 = myValueSetDao.create(vs1, mySrd).getId().toUnqualifiedVersionless();
|
||||
|
||||
ValueSet vs2 = new ValueSet();
|
||||
vs2.setUrl("http://hl7.org/foo/bar");
|
||||
IIdType vsId2 = myValueSetDao.create(vs2, mySrd).getId().toUnqualifiedVersionless();
|
||||
|
||||
IBundleProvider result;
|
||||
result = myValueSetDao.search(new SearchParameterMap().setLoadSynchronous(true).add(Constants.PARAM_FILTER,
|
||||
new StringParam("url le http://hl7.org/foo/baz")));
|
||||
assertThat(toUnqualifiedVersionlessIds(result), containsInAnyOrder(vsId1, vsId2));
|
||||
|
||||
result = myValueSetDao.search(new SearchParameterMap().setLoadSynchronous(true).add(Constants.PARAM_FILTER,
|
||||
new StringParam("url le http://hl7.org/foo/bar")));
|
||||
assertThat(toUnqualifiedVersionlessIds(result), containsInAnyOrder(vsId2));
|
||||
|
||||
result = myValueSetDao.search(new SearchParameterMap().setLoadSynchronous(true).add(Constants.PARAM_FILTER,
|
||||
new StringParam("url lt http://hl7.org/foo/baza")));
|
||||
assertThat(toUnqualifiedVersionlessIds(result), containsInAnyOrder(vsId1, vsId2));
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSearchUriSw() throws Exception {
|
||||
|
||||
ValueSet vs1 = new ValueSet();
|
||||
vs1.setUrl("http://hl7.org/foo/baz");
|
||||
IIdType vsId1 = myValueSetDao.create(vs1, mySrd).getId().toUnqualifiedVersionless();
|
||||
|
||||
ValueSet vs2 = new ValueSet();
|
||||
vs2.setUrl("http://hl7.org/foo/bar");
|
||||
IIdType vsId2 = myValueSetDao.create(vs2, mySrd).getId().toUnqualifiedVersionless();
|
||||
|
||||
IBundleProvider result;
|
||||
result = myValueSetDao.search(new SearchParameterMap().setLoadSynchronous(true).add(Constants.PARAM_FILTER,
|
||||
new StringParam("url sw http://hl7.org")));
|
||||
assertThat(toUnqualifiedVersionlessIds(result), containsInAnyOrder(vsId1, vsId2));
|
||||
|
||||
result = myValueSetDao.search(new SearchParameterMap().setLoadSynchronous(true).add(Constants.PARAM_FILTER,
|
||||
new StringParam("url sw hl7.org/foo/bar")));
|
||||
assertThat(toUnqualifiedVersionlessIds(result), Matchers.empty());
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSearchUriEw() throws Exception {
|
||||
|
||||
ValueSet vs1 = new ValueSet();
|
||||
vs1.setUrl("http://hl7.org/foo/baz");
|
||||
IIdType vsId1 = myValueSetDao.create(vs1, mySrd).getId().toUnqualifiedVersionless();
|
||||
|
||||
ValueSet vs2 = new ValueSet();
|
||||
vs2.setUrl("http://hl7.org/foo/bar");
|
||||
IIdType vsId2 = myValueSetDao.create(vs2, mySrd).getId().toUnqualifiedVersionless();
|
||||
|
||||
IBundleProvider result;
|
||||
result = myValueSetDao.search(new SearchParameterMap().setLoadSynchronous(true).add(Constants.PARAM_FILTER,
|
||||
new StringParam("url ew baz")));
|
||||
assertThat(toUnqualifiedVersionlessIds(result), containsInAnyOrder(vsId1));
|
||||
|
||||
result = myValueSetDao.search(new SearchParameterMap().setLoadSynchronous(true).add(Constants.PARAM_FILTER,
|
||||
new StringParam("url ew ba")));
|
||||
assertThat(toUnqualifiedVersionlessIds(result), Matchers.empty());
|
||||
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void afterClassClearContext() {
|
||||
TestUtil.clearAllStaticFieldsForUnitTest();
|
||||
|
|
|
@ -463,12 +463,12 @@ public class FhirResourceDaoR4Test extends BaseJpaR4Test {
|
|||
{
|
||||
IBundleProvider found = myObservationDao.search(new SearchParameterMap(Observation.SP_VALUE_QUANTITY, new QuantityParam("123", "foo", "bar")).setLoadSynchronous(true));
|
||||
List<IIdType> list = toUnqualifiedVersionlessIds(found);
|
||||
assertThat(list, containsInAnyOrder(id3));
|
||||
assertThat(list, Matchers.empty());
|
||||
}
|
||||
{
|
||||
IBundleProvider found = myObservationDao.search(new SearchParameterMap(Observation.SP_VALUE_QUANTITY, new QuantityParam("123.0", "foo", "bar")).setLoadSynchronous(true));
|
||||
List<IIdType> list = toUnqualifiedVersionlessIds(found);
|
||||
assertThat(list, containsInAnyOrder(id3));
|
||||
assertThat(list, Matchers.empty());
|
||||
}
|
||||
{
|
||||
IBundleProvider found = myObservationDao.search(new SearchParameterMap(Observation.SP_VALUE_QUANTITY, new QuantityParam("123.01", "foo", "bar")).setLoadSynchronous(true));
|
||||
|
@ -483,12 +483,12 @@ public class FhirResourceDaoR4Test extends BaseJpaR4Test {
|
|||
{
|
||||
IBundleProvider found = myObservationDao.search(new SearchParameterMap(Observation.SP_VALUE_QUANTITY, new QuantityParam("123.02", "foo", "bar")).setLoadSynchronous(true));
|
||||
List<IIdType> list = toUnqualifiedVersionlessIds(found);
|
||||
assertThat(list, containsInAnyOrder());
|
||||
assertThat(list, Matchers.empty());
|
||||
}
|
||||
{
|
||||
IBundleProvider found = myObservationDao.search(new SearchParameterMap(Observation.SP_VALUE_QUANTITY, new QuantityParam("123.001", "foo", "bar")).setLoadSynchronous(true));
|
||||
List<IIdType> list = toUnqualifiedVersionlessIds(found);
|
||||
assertThat(list, containsInAnyOrder());
|
||||
assertThat(list, Matchers.empty());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -282,9 +282,7 @@ public final class ResourceIndexedSearchParams {
|
|||
} else {
|
||||
ForcedId forcedId = target.getForcedId();
|
||||
if (forcedId != null) {
|
||||
// TODO KHS is forcedId.getForcedId().equals(theReference.getIdPart() also valid?
|
||||
return forcedId.getForcedId().equals(theReference.getValue()) ||
|
||||
forcedId.getForcedId().equals(theReference.getIdPart());
|
||||
return forcedId.getForcedId().equals(theReference.getValue());
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -23,12 +23,14 @@ package ca.uhn.fhir.jpa.searchparam.matcher;
|
|||
import ca.uhn.fhir.context.FhirContext;
|
||||
import ca.uhn.fhir.context.RuntimeResourceDefinition;
|
||||
import ca.uhn.fhir.context.RuntimeSearchParam;
|
||||
import ca.uhn.fhir.jpa.model.entity.ModelConfig;
|
||||
import ca.uhn.fhir.jpa.searchparam.MatchUrlService;
|
||||
import ca.uhn.fhir.jpa.searchparam.SearchParameterMap;
|
||||
import ca.uhn.fhir.jpa.searchparam.extractor.ResourceIndexedSearchParams;
|
||||
import ca.uhn.fhir.jpa.searchparam.registry.ISearchParamRegistry;
|
||||
import ca.uhn.fhir.jpa.searchparam.util.SourceParam;
|
||||
import ca.uhn.fhir.model.api.IQueryParameterType;
|
||||
import ca.uhn.fhir.model.primitive.IdDt;
|
||||
import ca.uhn.fhir.rest.api.Constants;
|
||||
import ca.uhn.fhir.rest.api.RestSearchParameterTypeEnum;
|
||||
import ca.uhn.fhir.rest.param.BaseParamWithPrefix;
|
||||
|
@ -56,6 +58,8 @@ public class InMemoryResourceMatcher {
|
|||
@Autowired
|
||||
ISearchParamRegistry mySearchParamRegistry;
|
||||
@Autowired
|
||||
ModelConfig myModelConfig;
|
||||
@Autowired
|
||||
FhirContext myFhirContext;
|
||||
|
||||
/**
|
||||
|
@ -212,9 +216,29 @@ public class InMemoryResourceMatcher {
|
|||
}
|
||||
|
||||
private boolean matchParams(String theResourceName, String theParamName, RuntimeSearchParam paramDef, List<? extends IQueryParameterType> theNextAnd, ResourceIndexedSearchParams theSearchParams) {
|
||||
if (paramDef.getParamType() == RestSearchParameterTypeEnum.REFERENCE) {
|
||||
stripBaseUrlsFromReferenceParams(theNextAnd);
|
||||
}
|
||||
return theNextAnd.stream().anyMatch(token -> theSearchParams.matchParam(theResourceName, theParamName, paramDef, token));
|
||||
}
|
||||
|
||||
private void stripBaseUrlsFromReferenceParams(List<? extends IQueryParameterType> theNextAnd) {
|
||||
if (myModelConfig.getTreatBaseUrlsAsLocal().isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (IQueryParameterType param : theNextAnd) {
|
||||
ReferenceParam ref = (ReferenceParam) param;
|
||||
IIdType dt = new IdDt(ref.getBaseUrl(), ref.getResourceType(), ref.getIdPart(), null);
|
||||
|
||||
if (dt.hasBaseUrl()) {
|
||||
if (myModelConfig.getTreatBaseUrlsAsLocal().contains(dt.getBaseUrl())) {
|
||||
ref.setValue(dt.toUnqualified().getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean hasChain(List<List<IQueryParameterType>> theAndOrParams) {
|
||||
return theAndOrParams.stream().flatMap(List::stream).anyMatch(param -> param instanceof ReferenceParam && ((ReferenceParam) param).getChain() != null);
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package ca.uhn.fhir.jpa.searchparam.matcher;
|
|||
|
||||
import ca.uhn.fhir.context.FhirContext;
|
||||
import ca.uhn.fhir.context.RuntimeSearchParam;
|
||||
import ca.uhn.fhir.jpa.model.entity.ModelConfig;
|
||||
import ca.uhn.fhir.jpa.model.entity.ResourceIndexedSearchParamDate;
|
||||
import ca.uhn.fhir.jpa.searchparam.MatchUrlService;
|
||||
import ca.uhn.fhir.jpa.searchparam.extractor.ResourceIndexedSearchParams;
|
||||
|
@ -67,6 +68,11 @@ public class InMemoryResourceMatcherR5Test {
|
|||
FhirContext fhirContext() {
|
||||
return FhirContext.forR5();
|
||||
}
|
||||
|
||||
@Bean
|
||||
ModelConfig modelConfig() {
|
||||
return new ModelConfig();
|
||||
}
|
||||
}
|
||||
|
||||
@Before
|
||||
|
|
|
@ -1,18 +1,23 @@
|
|||
package ca.uhn.fhir.jpa.subscription.module.matcher;
|
||||
|
||||
import ca.uhn.fhir.jpa.model.entity.ModelConfig;
|
||||
import ca.uhn.fhir.jpa.searchparam.matcher.InMemoryMatchResult;
|
||||
import ca.uhn.fhir.jpa.searchparam.matcher.SearchParamMatcher;
|
||||
import ca.uhn.fhir.jpa.subscription.module.BaseSubscriptionDstu3Test;
|
||||
import ca.uhn.fhir.rest.api.server.IBundleProvider;
|
||||
import ca.uhn.fhir.rest.server.SimpleBundleProvider;
|
||||
import ca.uhn.fhir.util.UrlUtil;
|
||||
import org.hl7.fhir.dstu3.model.*;
|
||||
import org.hl7.fhir.dstu3.model.codesystems.MedicationRequestCategory;
|
||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
import org.hl7.fhir.instance.model.api.IIdType;
|
||||
import org.junit.After;
|
||||
import org.junit.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
|
@ -21,6 +26,8 @@ public class InMemorySubscriptionMatcherR3Test extends BaseSubscriptionDstu3Test
|
|||
SubscriptionStrategyEvaluator mySubscriptionStrategyEvaluator;
|
||||
@Autowired
|
||||
SearchParamMatcher mySearchParamMatcher;
|
||||
@Autowired
|
||||
ModelConfig myModelConfig;
|
||||
|
||||
private void assertUnsupported(IBaseResource resource, String criteria) {
|
||||
assertFalse(mySearchParamMatcher.match(criteria, resource, null).supported());
|
||||
|
@ -48,6 +55,10 @@ public class InMemorySubscriptionMatcherR3Test extends BaseSubscriptionDstu3Test
|
|||
assertEquals(theSubscriptionMatchingStrategy, mySubscriptionStrategyEvaluator.determineStrategy(criteria));
|
||||
}
|
||||
|
||||
@After
|
||||
public void after() {
|
||||
myModelConfig.setTreatBaseUrlsAsLocal(new ModelConfig().getTreatBaseUrlsAsLocal());
|
||||
}
|
||||
|
||||
/**
|
||||
* Technically this is an invalid reference in most cases, but this shouldn't choke
|
||||
|
@ -580,4 +591,35 @@ public class InMemorySubscriptionMatcherR3Test extends BaseSubscriptionDstu3Test
|
|||
|
||||
assertNotMatched(observation, criteria);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testExternalReferenceMatches() {
|
||||
String goodReference = "http://example.com/base/Organization/FOO";
|
||||
String goodCriteria = "Patient?organization=" + UrlUtil.escapeUrlParam(goodReference);
|
||||
|
||||
String badReference1 = "http://example.com/bad/Organization/FOO";
|
||||
String badCriteria1 = "Patient?organization=" + UrlUtil.escapeUrlParam(badReference1);
|
||||
|
||||
String badReference2 = "http://example.org/base/Organization/FOO";
|
||||
String badCriteria2 = "Patient?organization=" + UrlUtil.escapeUrlParam(badReference2);
|
||||
|
||||
String badReference3 = "https://example.com/base/Organization/FOO";
|
||||
String badCriteria3 = "Patient?organization=" + UrlUtil.escapeUrlParam(badReference3);
|
||||
|
||||
String badReference4 = "http://example.com/base/Organization/GOO";
|
||||
String badCriteria4 = "Patient?organization=" + UrlUtil.escapeUrlParam(badReference4);
|
||||
|
||||
Set<String> urls = new HashSet<>();
|
||||
urls.add("http://example.com/base/");
|
||||
myModelConfig.setTreatBaseUrlsAsLocal(urls);
|
||||
|
||||
Patient patient = new Patient();
|
||||
patient.getManagingOrganization().setReference("Organization/FOO");
|
||||
|
||||
assertMatched(patient, goodCriteria);
|
||||
assertNotMatched(patient, badCriteria1);
|
||||
assertNotMatched(patient, badCriteria2);
|
||||
assertNotMatched(patient, badCriteria3);
|
||||
assertNotMatched(patient, badCriteria4);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,6 +20,8 @@ package ca.uhn.fhir.rest.server.servlet;
|
|||
* #L%
|
||||
*/
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
@ -27,6 +29,7 @@ import java.util.Map;
|
|||
|
||||
public class ServletSubRequestDetails extends ServletRequestDetails {
|
||||
|
||||
private final ServletRequestDetails myWrap;
|
||||
private Map<String, List<String>> myHeaders = new HashMap<>();
|
||||
|
||||
/**
|
||||
|
@ -36,6 +39,9 @@ public class ServletSubRequestDetails extends ServletRequestDetails {
|
|||
*/
|
||||
public ServletSubRequestDetails(ServletRequestDetails theRequestDetails) {
|
||||
super(theRequestDetails.getInterceptorBroadcaster());
|
||||
|
||||
myWrap = theRequestDetails;
|
||||
|
||||
if (theRequestDetails != null) {
|
||||
Map<String, List<String>> headers = theRequestDetails.getHeaders();
|
||||
for (Map.Entry<String, List<String>> next : headers.entrySet()) {
|
||||
|
@ -44,13 +50,19 @@ public class ServletSubRequestDetails extends ServletRequestDetails {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpServletRequest getServletRequest() {
|
||||
return myWrap.getServletRequest();
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpServletResponse getServletResponse() {
|
||||
return myWrap.getServletResponse();
|
||||
}
|
||||
|
||||
public void addHeader(String theName, String theValue) {
|
||||
String lowerCase = theName.toLowerCase();
|
||||
List<String> list = myHeaders.get(lowerCase);
|
||||
if (list == null) {
|
||||
list = new ArrayList<>();
|
||||
myHeaders.put(lowerCase, list);
|
||||
}
|
||||
List<String> list = myHeaders.computeIfAbsent(lowerCase, k -> new ArrayList<>());
|
||||
list.add(theValue);
|
||||
}
|
||||
|
||||
|
@ -72,6 +84,11 @@ public class ServletSubRequestDetails extends ServletRequestDetails {
|
|||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Object, Object> getUserData() {
|
||||
return myWrap.getUserData();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSubRequest() {
|
||||
return true;
|
||||
|
|
|
@ -5,10 +5,16 @@ import ca.uhn.fhir.rest.api.Constants;
|
|||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.Validate;
|
||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
import org.hl7.fhir.r4.model.*;
|
||||
import org.hl7.fhir.r4.model.Bundle;
|
||||
import org.hl7.fhir.r4.model.Bundle.BundleEntryComponent;
|
||||
import org.hl7.fhir.r4.model.CodeSystem;
|
||||
import org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode;
|
||||
import org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionComponent;
|
||||
import org.hl7.fhir.r4.model.CodeType;
|
||||
import org.hl7.fhir.r4.model.DomainResource;
|
||||
import org.hl7.fhir.r4.model.StructureDefinition;
|
||||
import org.hl7.fhir.r4.model.UriType;
|
||||
import org.hl7.fhir.r4.model.ValueSet;
|
||||
import org.hl7.fhir.r4.model.ValueSet.ConceptReferenceComponent;
|
||||
import org.hl7.fhir.r4.model.ValueSet.ConceptSetComponent;
|
||||
import org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionComponent;
|
||||
|
@ -19,9 +25,16 @@ import org.hl7.fhir.utilities.validation.ValidationMessage.IssueSeverity;
|
|||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import static org.apache.commons.lang3.StringUtils.*;
|
||||
import static org.apache.commons.lang3.StringUtils.defaultString;
|
||||
import static org.apache.commons.lang3.StringUtils.isBlank;
|
||||
import static org.apache.commons.lang3.StringUtils.isNotBlank;
|
||||
|
||||
public class DefaultProfileValidationSupport implements IValidationSupport {
|
||||
|
||||
|
@ -177,6 +190,11 @@ public class DefaultProfileValidationSupport implements IValidationSupport {
|
|||
return cs != null && cs.getContent() != CodeSystemContentMode.NOTPRESENT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValueSetSupported(FhirContext theContext, String theValueSetUrl) {
|
||||
return isNotBlank(theValueSetUrl) && fetchValueSet(theContext, theValueSetUrl) != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StructureDefinition generateSnapshot(StructureDefinition theInput, String theUrl, String theWebUrl, String theProfileName) {
|
||||
return null;
|
||||
|
@ -304,16 +322,16 @@ public class DefaultProfileValidationSupport implements IValidationSupport {
|
|||
ValueSet valueSet = fetchValueSet(theContext, theValueSetUrl);
|
||||
if (valueSet != null) {
|
||||
ValueSetExpander.ValueSetExpansionOutcome expanded = expander.expand(valueSet, null);
|
||||
Optional<ValueSet.ValueSetExpansionContainsComponent> haveMatch = expanded
|
||||
.getValueset()
|
||||
.getExpansion()
|
||||
.getContains()
|
||||
.stream()
|
||||
.filter(t -> (Constants.codeSystemNotNeeded(theCodeSystem) || t.getSystem().equals(theCodeSystem)) && t.getCode().equals(theCode))
|
||||
.findFirst();
|
||||
if (haveMatch.isPresent()) {
|
||||
return new CodeValidationResult(new ConceptDefinitionComponent(new CodeType(theCode)));
|
||||
ValueSetExpansionComponent expansion = expanded.getValueset().getExpansion();
|
||||
for (ValueSet.ValueSetExpansionContainsComponent nextExpansionCode : expansion.getContains()) {
|
||||
|
||||
if (theCode.equals(nextExpansionCode.getCode())) {
|
||||
if (Constants.codeSystemNotNeeded(theCodeSystem) || nextExpansionCode.getSystem().equals(theCodeSystem)) {
|
||||
return new CodeValidationResult(new CodeSystem.ConceptDefinitionComponent(new CodeType(theCode)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
} catch (Exception e) {
|
||||
return new CodeValidationResult(IssueSeverity.WARNING, e.getMessage());
|
||||
|
@ -343,7 +361,7 @@ public class DefaultProfileValidationSupport implements IValidationSupport {
|
|||
|
||||
@Override
|
||||
public LookupCodeResult lookupCode(FhirContext theContext, String theSystem, String theCode) {
|
||||
return validateCode(theContext, theSystem, theCode, null, (String)null).asLookupCodeResult(theSystem, theCode);
|
||||
return validateCode(theContext, theSystem, theCode, null, (String) null).asLookupCodeResult(theSystem, theCode);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -228,7 +228,7 @@ public final class HapiWorkerContext implements IWorkerContext, ValueSetExpander
|
|||
|
||||
@Override
|
||||
public ValidationResult validateCode(TerminologyServiceOptions theOptions, String code, ValueSet vs) {
|
||||
return validateCode(theOptions, null, code, null, vs);
|
||||
return validateCode(theOptions, Constants.CODESYSTEM_VALIDATE_NOT_NEEDED, code, null, vs);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -75,6 +75,17 @@ public interface IValidationSupport
|
|||
@Override
|
||||
boolean isCodeSystemSupported(FhirContext theContext, String theSystem);
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> if the given valueset can be validated by the given
|
||||
* validation support module
|
||||
*
|
||||
* @param theContext The FHIR context
|
||||
* @param theValueSetUrl The URL
|
||||
*/
|
||||
default boolean isValueSetSupported(FhirContext theContext, String theValueSetUrl) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a snapshot from the given differential profile.
|
||||
*
|
||||
|
|
|
@ -239,8 +239,14 @@
|
|||
<artifactId>httpclient</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-core</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<reporting>
|
||||
<plugins>
|
||||
|
|
|
@ -1,21 +1,31 @@
|
|||
package org.hl7.fhir.r4.hapi.validation;
|
||||
|
||||
import ca.uhn.fhir.context.FhirContext;
|
||||
import ca.uhn.fhir.rest.api.Constants;
|
||||
import org.apache.commons.lang3.Validate;
|
||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
import org.hl7.fhir.r4.hapi.ctx.DefaultProfileValidationSupport;
|
||||
import org.hl7.fhir.r4.hapi.ctx.HapiWorkerContext;
|
||||
import org.hl7.fhir.r4.hapi.ctx.IValidationSupport;
|
||||
import org.hl7.fhir.r4.model.CodeSystem;
|
||||
import org.hl7.fhir.r4.model.CodeType;
|
||||
import org.hl7.fhir.r4.model.MetadataResource;
|
||||
import org.hl7.fhir.r4.model.Parameters;
|
||||
import org.hl7.fhir.r4.model.StructureDefinition;
|
||||
import org.hl7.fhir.r4.model.UriType;
|
||||
import org.hl7.fhir.r4.model.ValueSet;
|
||||
import org.hl7.fhir.r4.model.ValueSet.ConceptSetComponent;
|
||||
import org.hl7.fhir.r4.terminologies.ValueSetExpander;
|
||||
import org.hl7.fhir.r4.terminologies.ValueSetExpanderSimple;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import static org.apache.commons.lang3.StringUtils.defaultString;
|
||||
import static org.apache.commons.lang3.StringUtils.isNotBlank;
|
||||
|
||||
/**
|
||||
|
@ -27,6 +37,7 @@ public class PrePopulatedValidationSupport implements IValidationSupport {
|
|||
private Map<String, CodeSystem> myCodeSystems;
|
||||
private Map<String, StructureDefinition> myStructureDefinitions;
|
||||
private Map<String, ValueSet> myValueSets;
|
||||
private DefaultProfileValidationSupport myDefaultProfileValidationSupport = new DefaultProfileValidationSupport();
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
|
@ -129,7 +140,43 @@ public class PrePopulatedValidationSupport implements IValidationSupport {
|
|||
|
||||
@Override
|
||||
public ValueSetExpander.ValueSetExpansionOutcome expandValueSet(FhirContext theContext, ConceptSetComponent theInclude) {
|
||||
return null;
|
||||
ValueSetExpander.ValueSetExpansionOutcome retVal = new ValueSetExpander.ValueSetExpansionOutcome(new ValueSet());
|
||||
|
||||
Set<String> wantCodes = new HashSet<>();
|
||||
for (ValueSet.ConceptReferenceComponent next : theInclude.getConcept()) {
|
||||
wantCodes.add(next.getCode());
|
||||
}
|
||||
|
||||
CodeSystem system = fetchCodeSystem(theContext, theInclude.getSystem());
|
||||
if (system != null) {
|
||||
List<CodeSystem.ConceptDefinitionComponent> concepts = system.getConcept();
|
||||
addConcepts(theInclude, retVal.getValueset().getExpansion(), wantCodes, concepts);
|
||||
}
|
||||
|
||||
for (UriType next : theInclude.getValueSet()) {
|
||||
ValueSet vs = myValueSets.get(defaultString(next.getValueAsString()));
|
||||
if (vs != null) {
|
||||
for (ConceptSetComponent nextInclude : vs.getCompose().getInclude()) {
|
||||
ValueSetExpander.ValueSetExpansionOutcome contents = expandValueSet(theContext, nextInclude);
|
||||
retVal.getValueset().getExpansion().getContains().addAll(contents.getValueset().getExpansion().getContains());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
private void addConcepts(ConceptSetComponent theInclude, ValueSet.ValueSetExpansionComponent theRetVal, Set<String> theWantCodes, List<CodeSystem.ConceptDefinitionComponent> theConcepts) {
|
||||
for (CodeSystem.ConceptDefinitionComponent next : theConcepts) {
|
||||
if (theWantCodes.isEmpty() || theWantCodes.contains(next.getCode())) {
|
||||
theRetVal
|
||||
.addContains()
|
||||
.setSystem(theInclude.getSystem())
|
||||
.setCode(next.getCode())
|
||||
.setDisplay(next.getDisplay());
|
||||
}
|
||||
addConcepts(theInclude, theRetVal, theWantCodes, next.getConcept());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -143,7 +190,7 @@ public class PrePopulatedValidationSupport implements IValidationSupport {
|
|||
|
||||
@Override
|
||||
public List<StructureDefinition> fetchAllStructureDefinitions(FhirContext theContext) {
|
||||
return new ArrayList<StructureDefinition>(myStructureDefinitions.values());
|
||||
return new ArrayList<>(myStructureDefinitions.values());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -179,7 +226,12 @@ public class PrePopulatedValidationSupport implements IValidationSupport {
|
|||
|
||||
@Override
|
||||
public boolean isCodeSystemSupported(FhirContext theContext, String theSystem) {
|
||||
return false;
|
||||
return myCodeSystems.containsKey(theSystem);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValueSetSupported(FhirContext theContext, String theValueSetUrl) {
|
||||
return myValueSets.containsKey(theValueSetUrl);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -189,6 +241,29 @@ public class PrePopulatedValidationSupport implements IValidationSupport {
|
|||
|
||||
@Override
|
||||
public CodeValidationResult validateCode(FhirContext theContext, String theCodeSystem, String theCode, String theDisplay, String theValueSetUrl) {
|
||||
ValueSet vs;
|
||||
if (isNotBlank(theValueSetUrl)) {
|
||||
vs = myValueSets.get(theValueSetUrl);
|
||||
if (vs == null) {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
vs = new ValueSet();
|
||||
vs.getCompose().addInclude().setSystem(theCodeSystem);
|
||||
}
|
||||
|
||||
IValidationSupport support = new ValidationSupportChain(this, myDefaultProfileValidationSupport);
|
||||
ValueSetExpanderSimple expander = new ValueSetExpanderSimple(new HapiWorkerContext(theContext, support));
|
||||
ValueSetExpander.ValueSetExpansionOutcome expansion = expander.expand(vs, new Parameters());
|
||||
for (ValueSet.ValueSetExpansionContainsComponent nextExpansionCode : expansion.getValueset().getExpansion().getContains()) {
|
||||
|
||||
if (theCode.equals(nextExpansionCode.getCode())) {
|
||||
if (Constants.codeSystemNotNeeded(theCodeSystem) || nextExpansionCode.getSystem().equals(theCodeSystem)) {
|
||||
return new CodeValidationResult(new CodeSystem.ConceptDefinitionComponent(new CodeType(theCode)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@ import java.util.List;
|
|||
import java.util.Set;
|
||||
|
||||
import static org.apache.commons.lang3.StringUtils.isBlank;
|
||||
import static org.apache.commons.lang3.StringUtils.isNotBlank;
|
||||
|
||||
public class ValidationSupportChain implements IValidationSupport {
|
||||
|
||||
|
@ -129,6 +130,16 @@ public class ValidationSupportChain implements IValidationSupport {
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValueSetSupported(FhirContext theContext, String theValueSetUrl) {
|
||||
for (IValidationSupport next : myChain) {
|
||||
if (next.isValueSetSupported(theContext, theValueSetUrl)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StructureDefinition generateSnapshot(StructureDefinition theInput, String theUrl, String theWebUrl, String theProfileName) {
|
||||
StructureDefinition outcome = null;
|
||||
|
@ -147,15 +158,26 @@ public class ValidationSupportChain implements IValidationSupport {
|
|||
ourLog.debug("Validating code {} in chain with {} items", theCode, myChain.size());
|
||||
|
||||
for (IValidationSupport next : myChain) {
|
||||
if (next.isCodeSystemSupported(theCtx, theCodeSystem)) {
|
||||
boolean shouldTry = false;
|
||||
|
||||
if (isNotBlank(theValueSetUrl)) {
|
||||
if (next.isValueSetSupported(theCtx, theValueSetUrl)) {
|
||||
shouldTry = true;
|
||||
}
|
||||
} else if (next.isCodeSystemSupported(theCtx, theCodeSystem)) {
|
||||
shouldTry = true;
|
||||
} else {
|
||||
ourLog.debug("Chain item {} does not support code system {}", next, theCodeSystem);
|
||||
}
|
||||
|
||||
if (shouldTry) {
|
||||
CodeValidationResult result = next.validateCode(theCtx, theCodeSystem, theCode, theDisplay, theValueSetUrl);
|
||||
if (result != null) {
|
||||
ourLog.debug("Chain item {} returned outcome {}", next, result.isOk());
|
||||
return result;
|
||||
}
|
||||
} else {
|
||||
ourLog.debug("Chain item {} does not support code system {}", next, theCodeSystem);
|
||||
}
|
||||
|
||||
}
|
||||
return myChain.get(0).validateCode(theCtx, theCodeSystem, theCode, theDisplay, theValueSetUrl);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,104 @@
|
|||
package org.hl7.fhir.r4.validation;
|
||||
|
||||
import ca.uhn.fhir.context.FhirContext;
|
||||
import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
|
||||
import ca.uhn.fhir.test.BaseTest;
|
||||
import com.google.common.base.Charsets;
|
||||
import org.apache.commons.lang.Validate;
|
||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
import org.hl7.fhir.r4.context.IWorkerContext;
|
||||
import org.hl7.fhir.r4.hapi.ctx.DefaultProfileValidationSupport;
|
||||
import org.hl7.fhir.r4.hapi.ctx.HapiWorkerContext;
|
||||
import org.hl7.fhir.r4.hapi.ctx.IValidationSupport;
|
||||
import org.hl7.fhir.r4.hapi.validation.PrePopulatedValidationSupport;
|
||||
import org.hl7.fhir.r4.hapi.validation.ValidationSupportChain;
|
||||
import org.hl7.fhir.r4.model.CodeSystem;
|
||||
import org.hl7.fhir.r4.model.StructureDefinition;
|
||||
import org.hl7.fhir.r4.model.ValueSet;
|
||||
import org.hl7.fhir.utilities.TerminologyServiceOptions;
|
||||
import org.junit.Test;
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
|
||||
import org.springframework.core.io.support.ResourcePatternResolver;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.Reader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
public class HapiWorkerContextTest extends BaseTest {
|
||||
FhirContext ctx = FhirContext.forR4();
|
||||
|
||||
@Test
|
||||
public void testCodeInPrePopulatedValidationSupport() throws IOException {
|
||||
|
||||
PrePopulatedValidationSupport prePopulatedValidationSupport = new PrePopulatedValidationSupport();
|
||||
|
||||
getResources("/r4/carin/carin/codesystem/").forEach(t -> prePopulatedValidationSupport.addCodeSystem((CodeSystem) t));
|
||||
getResources("/r4/carin/uscore/codesystem/").forEach(t -> prePopulatedValidationSupport.addCodeSystem((CodeSystem) t));
|
||||
getResources("/r4/carin/carin/valueset/").forEach(t -> prePopulatedValidationSupport.addValueSet((ValueSet) t));
|
||||
getResources("/r4/carin/uscore/valueset/").forEach(t -> prePopulatedValidationSupport.addValueSet((ValueSet) t));
|
||||
getResources("/r4/carin/carin/structuredefinition/").forEach(t -> prePopulatedValidationSupport.addStructureDefinition((StructureDefinition) t));
|
||||
getResources("/r4/carin/uscore/structuredefinition/").forEach(t -> prePopulatedValidationSupport.addStructureDefinition((StructureDefinition) t));
|
||||
|
||||
IValidationSupport validationSupportChain = new ValidationSupportChain(
|
||||
new DefaultProfileValidationSupport(),
|
||||
prePopulatedValidationSupport
|
||||
);
|
||||
HapiWorkerContext workerCtx = new HapiWorkerContext(ctx, validationSupportChain);
|
||||
|
||||
ValueSet vs = new ValueSet();
|
||||
IWorkerContext.ValidationResult outcome;
|
||||
|
||||
// Built-in Codes
|
||||
|
||||
vs.setUrl("http://hl7.org/fhir/ValueSet/fm-status");
|
||||
outcome = workerCtx.validateCode(new TerminologyServiceOptions(), "active", vs);
|
||||
assertEquals(outcome.getMessage(), true, outcome.isOk());
|
||||
|
||||
outcome = workerCtx.validateCode(new TerminologyServiceOptions(), "active2", vs);
|
||||
assertEquals(outcome.getMessage(), false, outcome.isOk());
|
||||
assertEquals("Unknown code[active2] in system[(none)]", outcome.getMessage());
|
||||
|
||||
// PrePopulated codes
|
||||
|
||||
vs.setUrl("http://hl7.org/fhir/us/core/ValueSet/birthsex");
|
||||
outcome = workerCtx.validateCode(new TerminologyServiceOptions(), "F", vs);
|
||||
assertEquals(outcome.getMessage(), true, outcome.isOk());
|
||||
|
||||
outcome = workerCtx.validateCode(new TerminologyServiceOptions(), "F2", vs);
|
||||
assertEquals(outcome.getMessage(), false, outcome.isOk());
|
||||
assertEquals("Unknown code[F2] in system[(none)]", outcome.getMessage());
|
||||
|
||||
}
|
||||
|
||||
|
||||
private List<IBaseResource> getResources(String theDirectory) throws IOException {
|
||||
ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(HapiWorkerContext.class.getClassLoader());
|
||||
List<Resource> resources;
|
||||
String path = "classpath*:" + theDirectory + "*.json";
|
||||
try {
|
||||
resources = Arrays.asList(resolver.getResources(path));
|
||||
} catch (IOException theIoe) {
|
||||
throw new InternalErrorException("Unable to get resources from path: " + path, theIoe);
|
||||
}
|
||||
List<IBaseResource> retVal = new ArrayList<>();
|
||||
|
||||
for (Resource nextFileResource : resources) {
|
||||
try (InputStream is = nextFileResource.getInputStream()) {
|
||||
Reader reader = new InputStreamReader(is, Charsets.UTF_8);
|
||||
retVal.add(ctx.newJsonParser().parseResource(reader));
|
||||
}
|
||||
}
|
||||
|
||||
Validate.isTrue(retVal.size() > 0, "No files found in " + path);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
{"resourceType":"CodeSystem","id":"CARIN-BB-Adjudication-Category","meta":{"versionId":"4","lastUpdated":"2019-12-01T13:53:17.000-05:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>CARIN Blue Button Claim Adjudication Category Code System</h2><p>This code system http://hl7.org/fhir/us/carin/CodeSystem/carin-bb-adjudicationcategory defines the following codes:</p><table class=\"codes\"><tr><td style=\"white-space:nowrap\"><b>Code</b></td><td><b>Display</b></td><td><b>Definition</b></td></tr><tr><td style=\"white-space:nowrap\">benefitPaymentStatusCode<a name=\"CARIN-BB-Adjudication-Category-benefitPaymentStatusCode\"> </a></td><td>Benefit payment status code</td><td>Benefit payment status code</td></tr><tr><td style=\"white-space:nowrap\">paymentDenialCode<a name=\"CARIN-BB-Adjudication-Category-paymentDenialCode\"> </a></td><td>Payment denial code</td><td>Payment Denial Code</td></tr><tr><td style=\"white-space:nowrap\">submittedamount<a name=\"CARIN-BB-Adjudication-Category-submittedamount\"> </a></td><td>submitted amount</td><td/></tr><tr><td style=\"white-space:nowrap\">allowedamount<a name=\"CARIN-BB-Adjudication-Category-allowedamount\"> </a></td><td>allowed amount</td><td/></tr><tr><td style=\"white-space:nowrap\">deductibleamount<a name=\"CARIN-BB-Adjudication-Category-deductibleamount\"> </a></td><td>deductible amount</td><td/></tr><tr><td style=\"white-space:nowrap\">coinsuranceamount<a name=\"CARIN-BB-Adjudication-Category-coinsuranceamount\"> </a></td><td>coinsurance amount</td><td/></tr><tr><td style=\"white-space:nowrap\">copayamount<a name=\"CARIN-BB-Adjudication-Category-copayamount\"> </a></td><td>copay amount</td><td/></tr><tr><td style=\"white-space:nowrap\">noncoveredamount<a name=\"CARIN-BB-Adjudication-Category-noncoveredamount\"> </a></td><td>noncovered amount</td><td/></tr><tr><td style=\"white-space:nowrap\">cobamount<a name=\"CARIN-BB-Adjudication-Category-cobamount\"> </a></td><td>cob amount</td><td/></tr><tr><td style=\"white-space:nowrap\">paymentamount<a name=\"CARIN-BB-Adjudication-Category-paymentamount\"> </a></td><td>payment amount</td><td/></tr><tr><td style=\"white-space:nowrap\">patientpayamount<a name=\"CARIN-BB-Adjudication-Category-patientpayamount\"> </a></td><td>patient pay amount</td><td/></tr><tr><td style=\"white-space:nowrap\">denialreason<a name=\"CARIN-BB-Adjudication-Category-denialreason\"> </a></td><td>payment denial reason</td><td/></tr><tr><td style=\"white-space:nowrap\">innetworkbenefitpaymentstatus<a name=\"CARIN-BB-Adjudication-Category-innetworkbenefitpaymentstatus\"> </a></td><td>in network benefit payment status</td><td/></tr><tr><td style=\"white-space:nowrap\">outofnetworkbenefitpaymentstatus<a name=\"CARIN-BB-Adjudication-Category-outofnetworkbenefitpaymentstatus\"> </a></td><td>out of network benefit payment status</td><td/></tr><tr><td style=\"white-space:nowrap\">otherbenefitpaymentstatus<a name=\"CARIN-BB-Adjudication-Category-otherbenefitpaymentstatus\"> </a></td><td>other benefit payment status</td><td/></tr><tr><td style=\"white-space:nowrap\">allowedunits<a name=\"CARIN-BB-Adjudication-Category-allowedunits\"> </a></td><td>allowed units</td><td/></tr></table></div>"},"url":"http://hl7.org/fhir/us/carin/CodeSystem/carin-bb-adjudicationcategory","version":"0.1.59-DRAFT","name":"CARINBBAdjudicationCategory","title":"CARIN Blue Button Claim Adjudication Category Code System","status":"draft","date":"2019-07-27T00:00:00-04:00","publisher":"CARIN Alliance","caseSensitive":true,"content":"complete","concept":[{"code":"benefitPaymentStatusCode","display":"Benefit payment status code","definition":"Benefit payment status code"},{"code":"paymentDenialCode","display":"Payment denial code","definition":"Payment Denial Code"},{"code":"submittedamount","display":"submitted amount"},{"code":"allowedamount","display":"allowed amount"},{"code":"deductibleamount","display":"deductible amount"},{"code":"coinsuranceamount","display":"coinsurance amount"},{"code":"copayamount","display":"copay amount"},{"code":"noncoveredamount","display":"noncovered amount"},{"code":"cobamount","display":"cob amount"},{"code":"paymentamount","display":"payment amount"},{"code":"patientpayamount","display":"patient pay amount"},{"code":"denialreason","display":"payment denial reason"},{"code":"innetworkbenefitpaymentstatus","display":"in network benefit payment status"},{"code":"outofnetworkbenefitpaymentstatus","display":"out of network benefit payment status"},{"code":"otherbenefitpaymentstatus","display":"other benefit payment status"},{"code":"allowedunits","display":"allowed units"}]}
|
|
@ -0,0 +1 @@
|
|||
{"resourceType":"CodeSystem","id":"CARIN-BB-Claim-CareTeam-Role","meta":{"versionId":"4","lastUpdated":"2019-12-01T14:02:49.000-05:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>CARIN Blue Button Claim Care Team Role Code System</h2><p>This code system http://hl7.org/fhir/us/carin/CodeSystem/carin-bb-claimcareteamrole defines the following codes:</p><table class=\"codes\"><tr><td style=\"white-space:nowrap\"><b>Code</b></td><td><b>Display</b></td><td><b>Definition</b></td></tr><tr><td style=\"white-space:nowrap\">supervising<a name=\"CARIN-BB-Claim-CareTeam-Role-supervising\"> </a></td><td>Attending or Supervising provider</td><td/></tr><tr><td style=\"white-space:nowrap\">referring<a name=\"CARIN-BB-Claim-CareTeam-Role-referring\"> </a></td><td>Referring provider</td><td/></tr><tr><td style=\"white-space:nowrap\">performing<a name=\"CARIN-BB-Claim-CareTeam-Role-performing\"> </a></td><td>Servicing or Rendering provider</td><td/></tr><tr><td style=\"white-space:nowrap\">prescribing<a name=\"CARIN-BB-Claim-CareTeam-Role-prescribing\"> </a></td><td>Prescribing provider</td><td/></tr><tr><td style=\"white-space:nowrap\">pcp<a name=\"CARIN-BB-Claim-CareTeam-Role-pcp\"> </a></td><td>Primary care provider</td><td/></tr></table></div>"},"url":"http://hl7.org/fhir/us/carin/CodeSystem/carin-bb-claimcareteamrole","version":"0.1.59-DRAFT","name":"CARINBBClaimCareTeamRole","title":"CARIN Blue Button Claim Care Team Role Code System","status":"draft","date":"2019-12-18T00:18:52-05:00","publisher":"CARIN Alliance","caseSensitive":true,"content":"complete","concept":[{"code":"supervising","display":"Attending or Supervising provider"},{"code":"referring","display":"Referring provider"},{"code":"performing","display":"Servicing or Rendering provider"},{"code":"prescribing","display":"Prescribing provider"},{"code":"pcp","display":"Primary care provider"}]}
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1 @@
|
|||
{"resourceType":"CodeSystem","id":"CARIN-BB-Claim-Type","meta":{"versionId":"5","lastUpdated":"2019-12-01T14:02:14.000-05:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>CARIN Blue Button Claim Type Code System</h2><p>This code system http://hl7.org/fhir/us/carin/CodeSystem/carin-bb-claim-type defines the following codes:</p><table class=\"codes\"><tr><td style=\"white-space:nowrap\"><b>Code</b></td><td><b>Display</b></td><td><b>Definition</b></td></tr><tr><td style=\"white-space:nowrap\">inpatient-facility<a name=\"CARIN-BB-Claim-Type-inpatient-facility\"> </a></td><td>Inpatient Facility</td><td/></tr><tr><td style=\"white-space:nowrap\">outpatient-facility<a name=\"CARIN-BB-Claim-Type-outpatient-facility\"> </a></td><td>Outpatient Facility</td><td/></tr><tr><td style=\"white-space:nowrap\">professional-nonclinician<a name=\"CARIN-BB-Claim-Type-professional-nonclinician\"> </a></td><td>Professional or Non-Clinician</td><td/></tr><tr><td style=\"white-space:nowrap\">pharmacy<a name=\"CARIN-BB-Claim-Type-pharmacy\"> </a></td><td>Pharmacy</td><td/></tr><tr><td style=\"white-space:nowrap\">vision<a name=\"CARIN-BB-Claim-Type-vision\"> </a></td><td>Vision</td><td/></tr><tr><td style=\"white-space:nowrap\">oral<a name=\"CARIN-BB-Claim-Type-oral\"> </a></td><td>Oral</td><td/></tr></table></div>"},"url":"http://hl7.org/fhir/us/carin/CodeSystem/carin-bb-claim-type","version":"0.1.59-DRAFT","name":"CARINBBClaimType","title":"CARIN Blue Button Claim Type Code System","status":"draft","date":"2019-12-18T00:18:52-05:00","publisher":"CARIN Alliance","caseSensitive":true,"content":"complete","concept":[{"code":"inpatient-facility","display":"Inpatient Facility"},{"code":"outpatient-facility","display":"Outpatient Facility"},{"code":"professional-nonclinician","display":"Professional or Non-Clinician"},{"code":"pharmacy","display":"Pharmacy"},{"code":"vision","display":"Vision"},{"code":"oral","display":"Oral"}]}
|
|
@ -0,0 +1 @@
|
|||
{"resourceType":"CodeSystem","id":"CARIN-BB-Network-Contracting-Status","meta":{"versionId":"3","lastUpdated":"2019-12-01T14:03:23.000-05:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>CARIN Blue Button Network Contracting Status Code System</h2><p>This code system http://hl7.org/fhir/us/carin/CodeSystem/carin-bb-networkcontractingstatus defines the following codes:</p><table class=\"codes\"><tr><td style=\"white-space:nowrap\"><b>Code</b></td><td><b>Display</b></td><td><b>Definition</b></td></tr><tr><td style=\"white-space:nowrap\">contracted<a name=\"CARIN-BB-Network-Contracting-Status-contracted\"> </a></td><td>contracted</td><td/></tr><tr><td style=\"white-space:nowrap\">non-contracted<a name=\"CARIN-BB-Network-Contracting-Status-non-contracted\"> </a></td><td>non-contracted</td><td/></tr></table></div>"},"url":"http://hl7.org/fhir/us/carin/CodeSystem/carin-bb-networkcontractingstatus","version":"0.1.59-DRAFT","name":"CARINBBNetworkContractingStatus","title":"CARIN Blue Button Network Contracting Status Code System","status":"draft","date":"2019-12-18T00:18:52-05:00","publisher":"CARIN Alliance","caseSensitive":true,"content":"complete","concept":[{"code":"contracted","display":"contracted"},{"code":"non-contracted","display":"non-contracted"}]}
|
|
@ -0,0 +1 @@
|
|||
{"resourceType":"CodeSystem","id":"CARIN-BB-Related-Claim-Relationship","meta":{"versionId":"3","lastUpdated":"2019-12-01T14:03:36.000-05:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>CARIN Blue Button Related Claim Relationship Code System</h2><p>This code system http://hl7.org/fhir/us/carin/CodeSystem/carin-bb-relatedclaimrelationship defines the following codes:</p><table class=\"codes\"><tr><td style=\"white-space:nowrap\"><b>Code</b></td><td><b>Display</b></td><td><b>Definition</b></td></tr><tr><td style=\"white-space:nowrap\">prior<a name=\"CARIN-BB-Related-Claim-Relationship-prior\"> </a></td><td>Prior claim</td><td/></tr><tr><td style=\"white-space:nowrap\">replaced<a name=\"CARIN-BB-Related-Claim-Relationship-replaced\"> </a></td><td>Replaced claim</td><td/></tr></table></div>"},"url":"http://hl7.org/fhir/us/carin/CodeSystem/carin-bb-relatedclaimrelationship","version":"0.1.59-DRAFT","name":"CARINBBRelatedClaimRelationship","title":"CARIN Blue Button Related Claim Relationship Code System","status":"draft","date":"2019-12-18T00:18:52-05:00","publisher":"CARIN Alliance","caseSensitive":true,"content":"complete","concept":[{"code":"prior","display":"Prior claim"},{"code":"replaced","display":"Replaced claim"}]}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -0,0 +1 @@
|
|||
{"resourceType":"ValueSet","id":"CARIN-BB-Adjudication-Amount-Category","meta":{"versionId":"5","lastUpdated":"2019-12-01T13:43:22.000-05:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>CARIN Blue Button Adjudication Amount Category Value Set</h2><div><p>Describes the various amount fields used when submitting and adjudicating a claim.</p>\n</div><p>This value set includes codes from the following code systems:</p><ul><li>Include these codes as defined in <a href=\"CodeSystem-CARIN-BB-Adjudication-Category.html\"><code>http://hl7.org/fhir/us/carin/CodeSystem/carin-bb-adjudicationcategory</code></a><table class=\"none\"><tr><td style=\"white-space:nowrap\"><b>Code</b></td><td><b>Display</b></td></tr><tr><td><a href=\"CodeSystem-CARIN-BB-Adjudication-Category.html#CARIN-BB-Adjudication-Category-submittedamount\">submittedamount</a></td><td>submitted amount</td><td/></tr><tr><td><a href=\"CodeSystem-CARIN-BB-Adjudication-Category.html#CARIN-BB-Adjudication-Category-allowedamount\">allowedamount</a></td><td>allowed amount</td><td/></tr><tr><td><a href=\"CodeSystem-CARIN-BB-Adjudication-Category.html#CARIN-BB-Adjudication-Category-deductibleamount\">deductibleamount</a></td><td>deductible amount</td><td/></tr><tr><td><a href=\"CodeSystem-CARIN-BB-Adjudication-Category.html#CARIN-BB-Adjudication-Category-coinsuranceamount\">coinsuranceamount</a></td><td>coinsurance amount</td><td/></tr><tr><td><a href=\"CodeSystem-CARIN-BB-Adjudication-Category.html#CARIN-BB-Adjudication-Category-copayamount\">copayamount</a></td><td>copay amount</td><td/></tr><tr><td><a href=\"CodeSystem-CARIN-BB-Adjudication-Category.html#CARIN-BB-Adjudication-Category-noncoveredamount\">noncoveredamount</a></td><td>noncovered amount</td><td/></tr><tr><td><a href=\"CodeSystem-CARIN-BB-Adjudication-Category.html#CARIN-BB-Adjudication-Category-cobamount\">cobamount</a></td><td>cob amount</td><td/></tr><tr><td><a href=\"CodeSystem-CARIN-BB-Adjudication-Category.html#CARIN-BB-Adjudication-Category-paymentamount\">paymentamount</a></td><td>payment amount</td><td/></tr><tr><td><a href=\"CodeSystem-CARIN-BB-Adjudication-Category.html#CARIN-BB-Adjudication-Category-patientpayamount\">patientpayamount</a></td><td>patient pay amount</td><td/></tr></table></li></ul></div>"},"url":"http://hl7.org/fhir/us/carin/ValueSet/carin-bb-adjudicationamountcategory","version":"0.1.59-DRAFT","name":"CARINBBAdjudicationAmountCategory","title":"CARIN Blue Button Adjudication Amount Category Value Set","status":"draft","date":"2019-12-18T00:18:52-05:00","description":"Describes the various amount fields used when submitting and adjudicating a claim.","compose":{"include":[{"system":"http://hl7.org/fhir/us/carin/CodeSystem/carin-bb-adjudicationcategory","concept":[{"code":"submittedamount","display":"submitted amount"},{"code":"allowedamount","display":"allowed amount"},{"code":"deductibleamount","display":"deductible amount"},{"code":"coinsuranceamount","display":"coinsurance amount"},{"code":"copayamount","display":"copay amount"},{"code":"noncoveredamount","display":"noncovered amount"},{"code":"cobamount","display":"cob amount"},{"code":"paymentamount","display":"payment amount"},{"code":"patientpayamount","display":"patient pay amount"}]}]}}
|
|
@ -0,0 +1 @@
|
|||
{"resourceType":"ValueSet","id":"CARIN-BB-Adjudication-Benefit-Payment-Status-Category","meta":{"versionId":"4","lastUpdated":"2019-11-30T04:16:33.000-05:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>CARIN Blue Button Adjudication Benefit Payment Status Category Value Set</h2><p>This value set includes codes from the following code systems:</p><ul><li>Include these codes as defined in <a href=\"CodeSystem-CARIN-BB-Adjudication-Category.html\"><code>http://hl7.org/fhir/us/carin/CodeSystem/carin-bb-adjudicationcategory</code></a><table class=\"none\"><tr><td style=\"white-space:nowrap\"><b>Code</b></td><td><b>Display</b></td></tr><tr><td><a href=\"CodeSystem-CARIN-BB-Adjudication-Category.html#CARIN-BB-Adjudication-Category-innetworkbenefitpaymentstatus\">innetworkbenefitpaymentstatus</a></td><td>in network benefit payment status</td><td/></tr><tr><td><a href=\"CodeSystem-CARIN-BB-Adjudication-Category.html#CARIN-BB-Adjudication-Category-outofnetworkbenefitpaymentstatus\">outofnetworkbenefitpaymentstatus</a></td><td>out of network benefit payment status</td><td/></tr><tr><td><a href=\"CodeSystem-CARIN-BB-Adjudication-Category.html#CARIN-BB-Adjudication-Category-otherbenefitpaymentstatus\">otherbenefitpaymentstatus</a></td><td>other benefit payment status</td><td/></tr></table></li></ul></div>"},"url":"http://hl7.org/fhir/us/carin/ValueSet/carin-bb-adjudicationbenefitpaymentstatuscategory","version":"0.1.59-DRAFT","name":"CARINBBAdjudicationBenefitPaymentStatusCategory","title":"CARIN Blue Button Adjudication Benefit Payment Status Category Value Set","status":"draft","date":"2019-12-18T00:18:52-05:00","compose":{"include":[{"system":"http://hl7.org/fhir/us/carin/CodeSystem/carin-bb-adjudicationcategory","concept":[{"code":"innetworkbenefitpaymentstatus","display":"in network benefit payment status"},{"code":"outofnetworkbenefitpaymentstatus","display":"out of network benefit payment status"},{"code":"otherbenefitpaymentstatus","display":"other benefit payment status"}]}]}}
|
|
@ -0,0 +1 @@
|
|||
{"resourceType":"ValueSet","id":"CARIN-BB-Adjudication-Category","meta":{"versionId":"5","lastUpdated":"2019-11-30T04:17:00.000-05:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>CARIN Blue Button Claim Adjudication Category Value Set</h2><p>This value set includes codes from the following code systems:</p><ul><li>Include these codes as defined in <a href=\"CodeSystem-CARIN-BB-Adjudication-Category.html\"><code>http://hl7.org/fhir/us/carin/CodeSystem/carin-bb-adjudicationcategory</code></a><table class=\"none\"><tr><td style=\"white-space:nowrap\"><b>Code</b></td><td><b>Display</b></td></tr><tr><td><a href=\"CodeSystem-CARIN-BB-Adjudication-Category.html#CARIN-BB-Adjudication-Category-benefitPaymentStatusCode\">benefitPaymentStatusCode</a></td><td>Benefit payment status code</td><td>Benefit payment status code</td></tr><tr><td><a href=\"CodeSystem-CARIN-BB-Adjudication-Category.html#CARIN-BB-Adjudication-Category-paymentDenialCode\">paymentDenialCode</a></td><td>Payment denial code</td><td>Payment Denial Code</td></tr><tr><td><a href=\"CodeSystem-CARIN-BB-Adjudication-Category.html#CARIN-BB-Adjudication-Category-submittedamount\">submittedamount</a></td><td>submitted amount</td><td/></tr><tr><td><a href=\"CodeSystem-CARIN-BB-Adjudication-Category.html#CARIN-BB-Adjudication-Category-allowedamount\">allowedamount</a></td><td>allowed amount</td><td/></tr><tr><td><a href=\"CodeSystem-CARIN-BB-Adjudication-Category.html#CARIN-BB-Adjudication-Category-deductibleamount\">deductibleamount</a></td><td>deductible amount</td><td/></tr><tr><td><a href=\"CodeSystem-CARIN-BB-Adjudication-Category.html#CARIN-BB-Adjudication-Category-coinsuranceamount\">coinsuranceamount</a></td><td>coinsurance amount</td><td/></tr><tr><td><a href=\"CodeSystem-CARIN-BB-Adjudication-Category.html#CARIN-BB-Adjudication-Category-copayamount\">copayamount</a></td><td>copay amount</td><td/></tr><tr><td><a href=\"CodeSystem-CARIN-BB-Adjudication-Category.html#CARIN-BB-Adjudication-Category-noncoveredamount\">noncoveredamount</a></td><td>noncovered amount</td><td/></tr><tr><td><a href=\"CodeSystem-CARIN-BB-Adjudication-Category.html#CARIN-BB-Adjudication-Category-cobamount\">cobamount</a></td><td>cob amount</td><td/></tr><tr><td><a href=\"CodeSystem-CARIN-BB-Adjudication-Category.html#CARIN-BB-Adjudication-Category-paymentamount\">paymentamount</a></td><td>payment amount</td><td/></tr><tr><td><a href=\"CodeSystem-CARIN-BB-Adjudication-Category.html#CARIN-BB-Adjudication-Category-patientpayamount\">patientpayamount</a></td><td>patient pay amount</td><td/></tr><tr><td><a href=\"CodeSystem-CARIN-BB-Adjudication-Category.html#CARIN-BB-Adjudication-Category-denialreason\">denialreason</a></td><td>payment denial reason</td><td/></tr><tr><td><a href=\"CodeSystem-CARIN-BB-Adjudication-Category.html#CARIN-BB-Adjudication-Category-innetworkbenefitpaymentstatus\">innetworkbenefitpaymentstatus</a></td><td>in network benefit payment status</td><td/></tr><tr><td><a href=\"CodeSystem-CARIN-BB-Adjudication-Category.html#CARIN-BB-Adjudication-Category-outofnetworkbenefitpaymentstatus\">outofnetworkbenefitpaymentstatus</a></td><td>out of network benefit payment status</td><td/></tr><tr><td><a href=\"CodeSystem-CARIN-BB-Adjudication-Category.html#CARIN-BB-Adjudication-Category-otherbenefitpaymentstatus\">otherbenefitpaymentstatus</a></td><td>other benefit payment status</td><td/></tr></table></li></ul></div>"},"url":"http://hl7.org/fhir/us/carin/ValueSet/carin-bb-adjudicationcategory","version":"0.1.59-DRAFT","name":"CARINBBAdjudicationCategory","title":"CARIN Blue Button Claim Adjudication Category Value Set","status":"draft","date":"2019-12-18T00:18:52-05:00","compose":{"include":[{"system":"http://hl7.org/fhir/us/carin/CodeSystem/carin-bb-adjudicationcategory","concept":[{"code":"benefitPaymentStatusCode","display":"Benefit payment status code"},{"code":"paymentDenialCode","display":"Payment denial code"},{"code":"submittedamount","display":"submitted amount"},{"code":"allowedamount","display":"allowed amount"},{"code":"deductibleamount","display":"deductible amount"},{"code":"coinsuranceamount","display":"coinsurance amount"},{"code":"copayamount","display":"copay amount"},{"code":"noncoveredamount","display":"noncovered amount"},{"code":"cobamount","display":"cob amount"},{"code":"paymentamount","display":"payment amount"},{"code":"patientpayamount","display":"patient pay amount"},{"code":"denialreason","display":"payment denial reason"},{"code":"innetworkbenefitpaymentstatus","display":"in network benefit payment status"},{"code":"outofnetworkbenefitpaymentstatus","display":"out of network benefit payment status"},{"code":"otherbenefitpaymentstatus","display":"other benefit payment status"}]}]}}
|
|
@ -0,0 +1 @@
|
|||
{"resourceType":"ValueSet","id":"CARIN-BB-Adjudication-Denial-Reason","meta":{"versionId":"5","lastUpdated":"2019-07-27T18:01:06.000-04:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>CARIN Blue Button Adjudication Denial Reason Value Set</h2><div><p>Code Lists\nASC X12 assists several organizations in the maintenance and distribution of code lists external to the X12 family of standards. The lists are maintained by the Centers for Medicare and Medicaid Services (CMS), The National Uniform Claim Committee (NUCC), and committees that meet during standing X12 meetings.</p>\n<p>Health Care Code Lists</p>\n<p>> Claim Adjustment Reason Codes (CARC) - http://www.wpc-edi.com/reference/codelists/healthcare/claim-adjustment-reason-codes</p>\n<p>> Remittance Advice Remark Codes (RARC) - http://www.wpc-edi.com/reference/codelists/healthcare/remittance-advice-remark-codes</p>\n</div><p>This value set includes codes from the following code systems:</p><ul><li>Include all codes defined in <code>http://www.wpc-edi.com/reference/codelists/healthcare/claim-adjustment-reason-codes</code></li><li>Include all codes defined in <code>http://www.wpc-edi.com/reference/codelists/healthcare/remittance-advice-remark-codes</code></li></ul></div>"},"url":"http://hl7.org/fhir/us/carin/ValueSet/carin-bb-adjudicationdenialreason","version":"0.1.59-DRAFT","name":"CARINBBAdjudicationDenialReason","title":"CARIN Blue Button Adjudication Denial Reason Value Set","status":"draft","date":"2019-12-18T00:18:52-05:00","description":"\nCode Lists\nASC X12 assists several organizations in the maintenance and distribution of code lists external to the X12 family of standards. The lists are maintained by the Centers for Medicare and Medicaid Services (CMS), The National Uniform Claim Committee (NUCC), and committees that meet during standing X12 meetings.\n\nHealth Care Code Lists\n\n> Claim Adjustment Reason Codes (CARC) - http://www.wpc-edi.com/reference/codelists/healthcare/claim-adjustment-reason-codes\n\n> Remittance Advice Remark Codes (RARC) - http://www.wpc-edi.com/reference/codelists/healthcare/remittance-advice-remark-codes","compose":{"include":[{"system":"http://www.wpc-edi.com/reference/codelists/healthcare/claim-adjustment-reason-codes"},{"system":"http://www.wpc-edi.com/reference/codelists/healthcare/remittance-advice-remark-codes"}]}}
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1 @@
|
|||
{"resourceType":"ValueSet","id":"CARIN-BB-Claim-CareTeam-Role","meta":{"versionId":"3","lastUpdated":"2019-07-27T07:56:52.000-04:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>CARIN Blue Button Claim Care Team Role Value Set</h2><p>This value set includes codes from the following code systems:</p><ul><li>Include these codes as defined in <a href=\"CodeSystem-CARIN-BB-Claim-CareTeam-Role.html\"><code>http://hl7.org/fhir/us/carin/CodeSystem/carin-bb-claimcareteamrole</code></a><table class=\"none\"><tr><td style=\"white-space:nowrap\"><b>Code</b></td><td><b>Display</b></td></tr><tr><td><a href=\"CodeSystem-CARIN-BB-Claim-CareTeam-Role.html#CARIN-BB-Claim-CareTeam-Role-supervising\">supervising</a></td><td>Attending or Supervising provider</td><td/></tr><tr><td><a href=\"CodeSystem-CARIN-BB-Claim-CareTeam-Role.html#CARIN-BB-Claim-CareTeam-Role-referring\">referring</a></td><td>Referring provider</td><td/></tr><tr><td><a href=\"CodeSystem-CARIN-BB-Claim-CareTeam-Role.html#CARIN-BB-Claim-CareTeam-Role-performing\">performing</a></td><td>Servicing or Rendering provider</td><td/></tr><tr><td><a href=\"CodeSystem-CARIN-BB-Claim-CareTeam-Role.html#CARIN-BB-Claim-CareTeam-Role-prescribing\">prescribing</a></td><td>Prescribing provider</td><td/></tr><tr><td><a href=\"CodeSystem-CARIN-BB-Claim-CareTeam-Role.html#CARIN-BB-Claim-CareTeam-Role-pcp\">pcp</a></td><td>Primary care provider</td><td/></tr></table></li></ul></div>"},"url":"http://hl7.org/fhir/us/carin/ValueSet/carin-bb-claimcareteamrole","version":"0.1.59-DRAFT","name":"CARINBBClaimCareTeamRole","title":"CARIN Blue Button Claim Care Team Role Value Set","status":"draft","date":"2019-12-18T00:18:52-05:00","compose":{"include":[{"system":"http://hl7.org/fhir/us/carin/CodeSystem/carin-bb-claimcareteamrole","version":"1.0.0","concept":[{"code":"supervising","display":"Attending or Supervising provider"},{"code":"referring","display":"Referring provider"},{"code":"performing","display":"Servicing or Rendering provider"},{"code":"prescribing","display":"Prescribing provider"},{"code":"pcp","display":"Primary care provider"}]}]}}
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1 @@
|
|||
{"resourceType":"ValueSet","id":"CARIN-BB-Claim-Type","meta":{"versionId":"3","lastUpdated":"2019-07-27T05:26:59.000-04:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>CARIN Blue Button Claim Type Value Set</h2><p>This value set includes codes from the following code systems:</p><ul><li>Include these codes as defined in <a href=\"CodeSystem-CARIN-BB-Claim-Type.html\"><code>http://hl7.org/fhir/us/carin/CodeSystem/carin-bb-claim-type</code></a><table class=\"none\"><tr><td style=\"white-space:nowrap\"><b>Code</b></td><td><b>Display</b></td></tr><tr><td><a href=\"CodeSystem-CARIN-BB-Claim-Type.html#CARIN-BB-Claim-Type-inpatient-facility\">inpatient-facility</a></td><td>Inpatient Facility</td><td/></tr><tr><td><a href=\"CodeSystem-CARIN-BB-Claim-Type.html#CARIN-BB-Claim-Type-outpatient-facility\">outpatient-facility</a></td><td>Outpatient Facility</td><td/></tr><tr><td><a href=\"CodeSystem-CARIN-BB-Claim-Type.html#CARIN-BB-Claim-Type-professional-nonclinician\">professional-nonclinician</a></td><td>Professional or Non-Clinician</td><td/></tr><tr><td><a href=\"CodeSystem-CARIN-BB-Claim-Type.html#CARIN-BB-Claim-Type-pharmacy\">pharmacy</a></td><td>Pharmacy</td><td/></tr><tr><td><a href=\"CodeSystem-CARIN-BB-Claim-Type.html#CARIN-BB-Claim-Type-vision\">vision</a></td><td>Vision</td><td/></tr><tr><td><a href=\"CodeSystem-CARIN-BB-Claim-Type.html#CARIN-BB-Claim-Type-oral\">oral</a></td><td>Oral</td><td/></tr></table></li></ul></div>"},"url":"http://hl7.org/fhir/us/carin/ValueSet/carin-bb-claim-type","version":"0.1.59-DRAFT","name":"CARINBBClaimType","title":"CARIN Blue Button Claim Type Value Set","status":"draft","date":"2019-12-18T00:18:52-05:00","compose":{"include":[{"system":"http://hl7.org/fhir/us/carin/CodeSystem/carin-bb-claim-type","version":"1.0.0","concept":[{"code":"inpatient-facility","display":"Inpatient Facility"},{"code":"outpatient-facility","display":"Outpatient Facility"},{"code":"professional-nonclinician","display":"Professional or Non-Clinician"},{"code":"pharmacy","display":"Pharmacy"},{"code":"vision","display":"Vision"},{"code":"oral","display":"Oral"}]}]}}
|
|
@ -0,0 +1 @@
|
|||
{"resourceType":"ValueSet","id":"CARIN-BB-DiagnosisType","meta":{"versionId":"3","lastUpdated":"2019-07-27T15:20:51.000-04:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>CARIN Blue Button Diagnosis Type Value Set</h2><p>This value set includes codes from the following code systems:</p><ul><li>Include these codes as defined in <code>http://snomed.info/sct/5991000124107/version/20170901</code><table class=\"none\"><tr><td style=\"white-space:nowrap\"><b>Code</b></td><td><b>Display</b></td></tr><tr><td>principal</td><td>principal</td><td/></tr><tr><td>secondary</td><td>secondary</td><td/></tr><tr><td>patient reason for visit</td><td>patient reason for visit</td><td/></tr><tr><td>external cause of injury</td><td>external cause of injury</td><td/></tr></table></li></ul></div>"},"url":"http://hl7.org/fhir/us/carin/ValueSet/carin-bb-diagnosistype","version":"0.1.59-DRAFT","name":"CARINBBDiagnosisType","title":"CARIN Blue Button Diagnosis Type Value Set","status":"draft","date":"2019-12-18T00:18:52-05:00","compose":{"include":[{"system":"http://snomed.info/sct/5991000124107/version/20170901","concept":[{"code":"principal","display":"principal"},{"code":"secondary","display":"secondary"},{"code":"patient reason for visit","display":"patient reason for visit"},{"code":"external cause of injury","display":"external cause of injury"}]}]}}
|
|
@ -0,0 +1 @@
|
|||
{"resourceType":"ValueSet","id":"CARIN-BB-HCPCS-ModifierCodes","meta":{"versionId":"3","lastUpdated":"2019-07-28T19:06:57.000-04:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>CARIN Blue Button HCPCS Modifier Codes Value Set</h2><div><p>HCPCS Release & Code Sets\nThis file contains the Level II alphanumeric HCPCS procedure and modifier codes, their long and short descriptions, and applicable Medicare administrative, coverage, and pricing data. The Level II HCPCS codes, which are established by CMS's Alpha-Numeric Editorial Panel, primarily represent items and supplies and non-physician services not covered by the American Medical Association's Current Procedural Terminology-4 (CPT-4) codes; Medicare, Medicaid, and private health insurers use HCPCS procedure and modifier codes for claims processing. Level II alphanumeric procedure and modifier codes comprise the A to V range.</p>\n</div><p>This value set includes codes from the following code systems:</p><ul><li>Include all codes defined in <code>https://www.cms.gov/Medicare/Coding/HCPCSReleaseCodeSets/Alpha-Numeric-HCPCS.html</code></li></ul></div>"},"url":"http://hl7.org/fhir/us/carin/ValueSet/carin-bb-hcpcs-modifiercodes","version":"0.1.59-DRAFT","name":"CARINBBHCPCSModifierCodes","title":"CARIN Blue Button HCPCS Modifier Codes Value Set","status":"draft","date":"2019-12-18T00:18:52-05:00","description":"HCPCS Release & Code Sets\nThis file contains the Level II alphanumeric HCPCS procedure and modifier codes, their long and short descriptions, and applicable Medicare administrative, coverage, and pricing data. The Level II HCPCS codes, which are established by CMS's Alpha-Numeric Editorial Panel, primarily represent items and supplies and non-physician services not covered by the American Medical Association's Current Procedural Terminology-4 (CPT-4) codes; Medicare, Medicaid, and private health insurers use HCPCS procedure and modifier codes for claims processing. Level II alphanumeric procedure and modifier codes comprise the A to V range.","compose":{"include":[{"system":"https://www.cms.gov/Medicare/Coding/HCPCSReleaseCodeSets/Alpha-Numeric-HCPCS.html"}]}}
|
|
@ -0,0 +1 @@
|
|||
{"resourceType":"ValueSet","id":"CARIN-BB-Identifier-Type","meta":{"versionId":"6","lastUpdated":"2019-12-01T22:49:55.000-05:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>CARIN Blue Button Identifier Type Value Set</h2><p>This value set includes codes from the following code systems:</p><ul><li>Include these codes as defined in <a href=\"http://hl7.org/fhir/R4/v2/0203/index.html\"><code>http://terminology.hl7.org/CodeSystem/v2-0203</code></a><table class=\"none\"><tr><td style=\"white-space:nowrap\"><b>Code</b></td><td><b>Display</b></td></tr><tr><td><a href=\"http://hl7.org/fhir/R4/v2/0203/index.html#v2-0203-MB\">MB</a></td><td>Member Number</td><td/></tr><tr><td><a href=\"http://hl7.org/fhir/R4/v2/0203/index.html#v2-0203-PT\">PT</a></td><td>Patient External Identifier</td><td/></tr><tr><td><a href=\"http://hl7.org/fhir/R4/v2/0203/index.html#v2-0203-MA\">MA</a></td><td>Patient Medicaid Number</td><td/></tr><tr><td><a href=\"http://hl7.org/fhir/R4/v2/0203/index.html#v2-0203-MC\">MC</a></td><td>Patient's Medicare Number</td><td/></tr><tr><td><a href=\"http://hl7.org/fhir/R4/v2/0203/index.html#v2-0203-SN\">SN</a></td><td>Subscriber Number</td><td/></tr><tr><td><a href=\"http://hl7.org/fhir/R4/v2/0203/index.html#v2-0203-NH\">NH</a></td><td>National Health Plan Identifier</td><td/></tr><tr><td><a href=\"http://hl7.org/fhir/R4/v2/0203/index.html#v2-0203-NPI\">NPI</a></td><td>National provider identifier</td><td/></tr><tr><td><a href=\"http://hl7.org/fhir/R4/v2/0203/index.html#v2-0203-MCD\">MCD</a></td><td>Practitioner Medicaid number</td><td/></tr><tr><td><a href=\"http://hl7.org/fhir/R4/v2/0203/index.html#v2-0203-MCR\">MCR</a></td><td>Practitioner Medicare number</td><td/></tr><tr><td><a href=\"http://hl7.org/fhir/R4/v2/0203/index.html#v2-0203-PPIN\">PPIN</a></td><td>Medicare/CMS Performing Provider Identification Number</td><td/></tr><tr><td><a href=\"http://hl7.org/fhir/R4/v2/0203/index.html#v2-0203-UPIN\">UPIN</a></td><td>Medicare/CMS (formerly HCFA)'s Universal Physician Identification numbers</td><td/></tr></table></li><li>Include all codes defined in <a href=\"http://hl7.org/fhir/R4/v2/0203/index.html\"><code>http://terminology.hl7.org/CodeSystem/v2-0203</code></a>, where the codes are contained in <a href=\"http://hl7.org/fhir/R4/valueset-identifier-type.html\">http://hl7.org/fhir/ValueSet/identifier-type</a></li></ul></div>"},"url":"http://hl7.org/fhir/us/carin/ValueSet/carin-bb-identifier-type","version":"0.1.59-DRAFT","name":"CARINBBIdentifierType","title":"CARIN Blue Button Identifier Type Value Set","status":"draft","date":"2019-12-18T00:18:52-05:00","compose":{"include":[{"system":"http://terminology.hl7.org/CodeSystem/v2-0203","concept":[{"code":"MB","display":"Member Number"},{"code":"PT","display":"Patient External Identifier"},{"code":"MA","display":"Patient Medicaid Number"},{"code":"MC","display":"Patient's Medicare Number"},{"code":"SN","display":"Subscriber Number"},{"code":"NH","display":"National Health Plan Identifier"},{"code":"NPI","display":"National provider identifier"},{"code":"MCD","display":"Practitioner Medicaid number"},{"code":"MCR","display":"Practitioner Medicare number"},{"code":"PPIN","display":"Medicare/CMS Performing Provider Identification Number"},{"code":"UPIN","display":"Medicare/CMS (formerly HCFA)'s Universal Physician Identification numbers"}]},{"system":"http://terminology.hl7.org/CodeSystem/v2-0203","valueSet":["http://hl7.org/fhir/ValueSet/identifier-type"]}]}}
|
|
@ -0,0 +1 @@
|
|||
{"resourceType":"ValueSet","id":"CARIN-BB-MS-DRG","meta":{"versionId":"5","lastUpdated":"2019-11-25T19:31:02.000-05:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>CARIN Blue Button MS-DRG Value Set</h2><div><p>This is the description for the MS-DRG value set.</p>\n</div><p><b>Copyright Statement:</b> The content of this value set is copyrighted by a party other than HL7</p><p>This value set includes codes from the following code systems:</p><ul><li>Include all codes defined in <code>https://www.cms.gov/Medicare/Medicare-Fee-for-Service-Payment/AcuteInpatientPPS/MS-DRG-Classifications-and-Software.html</code></li></ul></div>"},"url":"http://hl7.org/fhir/us/carin/ValueSet/carin-bb-ms-drg","version":"0.1.59-DRAFT","name":"CARINBBMSDRG","title":"CARIN Blue Button MS-DRG Value Set","status":"draft","date":"2019-12-18T00:18:52-05:00","description":"This is the description for the MS-DRG value set.","purpose":"This is the purpose of this value set.","copyright":"The content of this value set is copyrighted by a party other than HL7","compose":{"include":[{"system":"https://www.cms.gov/Medicare/Medicare-Fee-for-Service-Payment/AcuteInpatientPPS/MS-DRG-Classifications-and-Software.html"}]}}
|
|
@ -0,0 +1 @@
|
|||
{"resourceType":"ValueSet","id":"CARIN-BB-Network-Contracting-Status","meta":{"versionId":"2","lastUpdated":"2019-07-28T06:21:29.000-04:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>CARIN Blue Button Network Contracting Status Value Set</h2><p>This value set includes codes from the following code systems:</p><ul><li>Include these codes as defined in <a href=\"CodeSystem-CARIN-BB-Network-Contracting-Status.html\"><code>http://hl7.org/fhir/us/carin/CodeSystem/carin-bb-networkcontractingstatus</code></a><table class=\"none\"><tr><td style=\"white-space:nowrap\"><b>Code</b></td><td><b>Display</b></td></tr><tr><td><a href=\"CodeSystem-CARIN-BB-Network-Contracting-Status.html#CARIN-BB-Network-Contracting-Status-contracted\">contracted</a></td><td>contracted</td><td/></tr><tr><td><a href=\"CodeSystem-CARIN-BB-Network-Contracting-Status.html#CARIN-BB-Network-Contracting-Status-non-contracted\">non-contracted</a></td><td>non-contracted</td><td/></tr></table></li></ul></div>"},"url":"http://hl7.org/fhir/us/carin/ValueSet/carin-bb-networkcontractingstatus","version":"0.1.59-DRAFT","name":"CARINBBNetworkContractingStatus","title":"CARIN Blue Button Network Contracting Status Value Set","status":"draft","date":"2019-12-18T00:18:52-05:00","compose":{"include":[{"system":"http://hl7.org/fhir/us/carin/CodeSystem/carin-bb-networkcontractingstatus","concept":[{"code":"contracted","display":"contracted"},{"code":"non-contracted","display":"non-contracted"}]}]}}
|
|
@ -0,0 +1 @@
|
|||
{"resourceType":"ValueSet","id":"CARIN-BB-PlaceOfService","meta":{"versionId":"4","lastUpdated":"2019-07-28T18:42:06.000-04:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>CARIN Blue Button Place Of Service Codes For Professional Claims Value Set</h2><div><p>Place of Service Codes for Professional Claims</p>\n</div><p>This value set includes codes from the following code systems:</p><ul><li>Include all codes defined in <code>https://www.cms.gov/Medicare/Coding/place-of-service-codes/Place_of_Service_Code_Set.html</code></li></ul></div>"},"url":"http://hl7.org/fhir/us/carin/ValueSet/carin-bb-placeofservice","version":"0.1.59-DRAFT","name":"CARINBBPlaceOfService","title":"CARIN Blue Button Place Of Service Codes For Professional Claims Value Set","status":"draft","date":"2019-12-18T00:18:52-05:00","description":"Place of Service Codes for Professional Claims","compose":{"include":[{"system":"https://www.cms.gov/Medicare/Coding/place-of-service-codes/Place_of_Service_Code_Set.html"}]}}
|
|
@ -0,0 +1 @@
|
|||
{"resourceType":"ValueSet","id":"CARIN-BB-Related-Claim-Relationship","meta":{"versionId":"2","lastUpdated":"2019-07-27T07:01:18.000-04:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>CARIN Blue Button Related Claim Relationship Value Set</h2><p>This value set includes codes from the following code systems:</p><ul><li>Include these codes as defined in <a href=\"CodeSystem-CARIN-BB-Related-Claim-Relationship.html\"><code>http://hl7.org/fhir/us/carin/CodeSystem/carin-bb-relatedclaimrelationship</code></a><table class=\"none\"><tr><td style=\"white-space:nowrap\"><b>Code</b></td><td><b>Display</b></td></tr><tr><td><a href=\"CodeSystem-CARIN-BB-Related-Claim-Relationship.html#CARIN-BB-Related-Claim-Relationship-prior\">prior</a></td><td>Prior claim</td><td/></tr><tr><td><a href=\"CodeSystem-CARIN-BB-Related-Claim-Relationship.html#CARIN-BB-Related-Claim-Relationship-replaced\">replaced</a></td><td>Replaced claim</td><td/></tr></table></li></ul></div>"},"url":"http://hl7.org/fhir/us/carin/ValueSet/carin-bb-relatedclaimrelationship","version":"0.1.59-DRAFT","name":"CARINBBRelatedClaimRelationship","title":"CARIN Blue Button Related Claim Relationship Value Set","status":"draft","date":"2019-12-18T00:18:52-05:00","compose":{"include":[{"system":"http://hl7.org/fhir/us/carin/CodeSystem/carin-bb-relatedclaimrelationship","version":"1.0.0","concept":[{"code":"prior","display":"Prior claim"},{"code":"replaced","display":"Replaced claim"}]}]}}
|
|
@ -0,0 +1 @@
|
|||
{"resourceType":"ValueSet","id":"CARIN-BB-Revenue-Center","meta":{"versionId":"3","lastUpdated":"2019-07-28T07:01:28.000-04:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>CARIN Blue Button Revenue Center Value Set</h2><div><p>UB-04 Revenue Code (FL-42), Revenue Description (FL-43)</p>\n</div><p>This value set includes codes from the following code systems:</p><ul><li>Include all codes defined in <code>https://www.cms.gov/Medicare/CMS-Forms/CMS-Forms/CMS-Forms-Items/CMS1196256.html</code></li></ul></div>"},"url":"http://hl7.org/fhir/us/carin/ValueSet/carin-bb-revenue-center","version":"0.1.59-DRAFT","name":"CARINBBRevenueCenter","title":"CARIN Blue Button Revenue Center Value Set","status":"draft","date":"2019-12-18T00:18:52-05:00","description":"UB-04 Revenue Code (FL-42), Revenue Description (FL-43)","compose":{"include":[{"system":"https://www.cms.gov/Medicare/CMS-Forms/CMS-Forms/CMS-Forms-Items/CMS1196256.html"}]}}
|
|
@ -0,0 +1 @@
|
|||
{"resourceType":"ValueSet","id":"CARIN-BB-SNOMEDCT-ProcedureCodes","meta":{"versionId":"4","lastUpdated":"2019-07-28T19:15:57.000-04:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>CARIN Blue Button SNOMEDCT Procedure Codes Value Set</h2><div><p>This value set includes codes from the following code systems:</p>\n<p>Include codes from http://snomed.info/sct where concept is-a 71388002 (Procedure)</p>\n</div><p>This value set includes codes from the following code systems:</p><ul><li>Include all codes defined in <a href=\"http://www.snomed.org/\"><code>http://snomed.info/sct</code></a>, where the codes are contained in <a href=\"http://hl7.org/fhir/R4/valueset-procedure-code.html\">http://hl7.org/fhir/ValueSet/procedure-code</a></li></ul></div>"},"url":"http://hl7.org/fhir/us/carin/ValueSet/carin-bb-snomedct-procedurecodes","version":"0.1.59-DRAFT","name":"CARINBBSNOMEDCTProcedureCodes","title":"CARIN Blue Button SNOMEDCT Procedure Codes Value Set","status":"draft","date":"2019-12-18T00:18:52-05:00","description":"This value set includes codes from the following code systems:\n\nInclude codes from http://snomed.info/sct where concept is-a 71388002 (Procedure)","compose":{"include":[{"system":"http://snomed.info/sct","valueSet":["http://hl7.org/fhir/ValueSet/procedure-code"]}]}}
|
|
@ -0,0 +1 @@
|
|||
{"resourceType":"ValueSet","id":"CARIN-BB-TOB-BillClassification","meta":{"versionId":"3","lastUpdated":"2019-07-28T07:04:49.000-04:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>CARIN Blue Button Type Of Bill (Bill Classification) Value Set</h2><div><p>UB-04 Type of Bill (FL-4) structure - Type of care</p>\n</div><p>This value set includes codes from the following code systems:</p><ul><li>Include all codes defined in <code>https://www.cms.gov/Medicare/CMS-Forms/CMS-Forms/CMS-Forms-Items/CMS1196256.html</code></li></ul></div>"},"url":"http://hl7.org/fhir/us/carin/ValueSet/carin-bb-tob-billclassification","version":"0.1.59-DRAFT","name":"CARINBBTOBBillClassification","title":"CARIN Blue Button Type Of Bill (Bill Classification) Value Set","status":"draft","date":"2019-12-18T00:18:52-05:00","description":"UB-04 Type of Bill (FL-4) structure - Type of care\n","compose":{"include":[{"system":"https://www.cms.gov/Medicare/CMS-Forms/CMS-Forms/CMS-Forms-Items/CMS1196256.html"}]}}
|
|
@ -0,0 +1 @@
|
|||
{"resourceType":"ValueSet","id":"CARIN-BB-TOB-Frequency","meta":{"versionId":"3","lastUpdated":"2019-07-28T07:06:58.000-04:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>CARIN Blue Button Type Of Bill (Frequency) Value Set</h2><div><p>UB-04 Type of Bill (FL-4) structure - Sequence in this episode of care</p>\n</div><p>This value set includes codes from the following code systems:</p><ul><li>Include all codes defined in <code>https://www.cms.gov/Medicare/CMS-Forms/CMS-Forms/CMS-Forms-Items/CMS1196256.html</code></li></ul></div>"},"url":"http://hl7.org/fhir/us/carin/ValueSet/carin-bb-tob-frequency","version":"0.1.59-DRAFT","name":"CARINBBTOBFrequency","title":"CARIN Blue Button Type Of Bill (Frequency) Value Set","status":"draft","date":"2019-12-18T00:18:52-05:00","description":"UB-04 Type of Bill (FL-4) structure - Sequence in this episode of care\n","compose":{"include":[{"system":"https://www.cms.gov/Medicare/CMS-Forms/CMS-Forms/CMS-Forms-Items/CMS1196256.html"}]}}
|
|
@ -0,0 +1 @@
|
|||
{"resourceType":"ValueSet","id":"CARIN-BB-TOB-TypeOfFacility","meta":{"versionId":"3","lastUpdated":"2019-07-28T07:00:18.000-04:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>CARIN Blue Button Type Of Bill (Type Of Facility) Value Set</h2><div><p>UB-04 Type of Bill (FL-4) structure - Type of facility</p>\n</div><p>This value set includes codes from the following code systems:</p><ul><li>Include all codes defined in <code>https://www.cms.gov/Medicare/CMS-Forms/CMS-Forms/CMS-Forms-Items/CMS1196256.html</code></li></ul></div>"},"url":"http://hl7.org/fhir/us/carin/ValueSet/carin-bb-tob-typeoffacility","version":"0.1.59-DRAFT","name":"CARINBBTOBTypeOfFacility","title":"CARIN Blue Button Type Of Bill (Type Of Facility) Value Set","status":"draft","date":"2019-12-18T00:18:52-05:00","description":"UB-04 Type of Bill (FL-4) structure - Type of facility\n","compose":{"include":[{"system":"https://www.cms.gov/Medicare/CMS-Forms/CMS-Forms/CMS-Forms-Items/CMS1196256.html"}]}}
|
|
@ -0,0 +1 @@
|
|||
{"resourceType":"ValueSet","id":"CARIN-BB-TypeOfService","meta":{"versionId":"3","lastUpdated":"2019-07-28T06:41:25.000-04:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>CARIN Blue Button Type Of Service Value Set</h2><div><p>CMS_TYPE_SRVC_TB CMS Type of Service Table</p>\n<p>1 = Medical care\n2 = Surgery\n3 = Consultation\n4 = Diagnostic radiology\n5 = Diagnostic laboratory\n6 = Therapeutic radiology\n7 = Anesthesia\n8 = Assistant at surgery\n9 = Other medical items or services\n0 = Whole blood only eff 01/96, whole blood or packed red cells before 01/96\nA = Used durable medical equipment (DME)\nB = High risk screening mammography (obsolete 1/1/98)\nC = Low risk screening mammography (obsolete 1/1/98)\nD = Ambulance (eff 04/95)\nE = Enteral/parenteral nutrients/supplies (eff 04/95)\nF = Ambulatory surgical center (facility usage for surgical services)\nG = Immunosuppressive drugs\nH = Hospice services (discontinued 01/95)\nI = Purchase of DME (installment basis) (discontinued 04/95)\nJ = Diabetic shoes (eff 04/95)\nK = Hearing items and services (eff 04/95)\nL = ESRD supplies (eff 04/95) (renal supplier in the home before 04/95)\nM = Monthly capitation payment for dialysis\nN = Kidney donor\nP = Lump sum purchase of DME, prosthetics orthotics\nQ = Vision items or services\nR = Rental of DME\nS = Surgical dressings or other medical supplies (eff 04/95)\nT = Psychological therapy (term. 12/31/97) outpatient mental health limitation (eff. 1/1/98)\nU = Occupational therapy\nV = Pneumococcal/flu vaccine (eff 01/96), Pneumococcal/flu/hepatitis B vaccine (eff 04/95-12/95), Pneumococcal only before 04/95\nW = Physical therapy\nY = Second opinion on elective surgery (obsoleted 1/97)\nZ = Third opinion on elective surgery (obsoleted 1/97)</p>\n</div><p>This value set includes codes from the following code systems:</p><ul><li>Include all codes defined in <code>https://www.resdac.org/sites/resdac.umn.edu/files/CMS%20Type%20of%20Service%20Table.txt</code></li></ul></div>"},"url":"http://hl7.org/fhir/us/carin/ValueSet/carin-bb-typeofservice","version":"0.1.59-DRAFT","name":"CARINBBTypeOfService","title":"CARIN Blue Button Type Of Service Value Set","status":"draft","date":"2019-12-18T00:18:52-05:00","description":"CMS_TYPE_SRVC_TB CMS Type of Service Table\n\n 1 = Medical care\n 2 = Surgery\n 3 = Consultation\n 4 = Diagnostic radiology\n 5 = Diagnostic laboratory\n 6 = Therapeutic radiology\n 7 = Anesthesia\n 8 = Assistant at surgery\n 9 = Other medical items or services\n 0 = Whole blood only eff 01/96, whole blood or packed red cells before 01/96\n A = Used durable medical equipment (DME)\n B = High risk screening mammography (obsolete 1/1/98)\n C = Low risk screening mammography (obsolete 1/1/98)\n D = Ambulance (eff 04/95)\n E = Enteral/parenteral nutrients/supplies (eff 04/95)\n F = Ambulatory surgical center (facility usage for surgical services)\n G = Immunosuppressive drugs\n H = Hospice services (discontinued 01/95)\n I = Purchase of DME (installment basis) (discontinued 04/95)\n J = Diabetic shoes (eff 04/95)\n K = Hearing items and services (eff 04/95)\n L = ESRD supplies (eff 04/95) (renal supplier in the home before 04/95)\n M = Monthly capitation payment for dialysis\n N = Kidney donor\n P = Lump sum purchase of DME, prosthetics orthotics\n Q = Vision items or services\n R = Rental of DME\n S = Surgical dressings or other medical supplies (eff 04/95)\n T = Psychological therapy (term. 12/31/97) outpatient mental health limitation (eff. 1/1/98)\n U = Occupational therapy\n V = Pneumococcal/flu vaccine (eff 01/96), Pneumococcal/flu/hepatitis B vaccine (eff 04/95-12/95), Pneumococcal only before 04/95\n W = Physical therapy\n Y = Second opinion on elective surgery (obsoleted 1/97)\n Z = Third opinion on elective surgery (obsoleted 1/97)","compose":{"include":[{"system":"https://www.resdac.org/sites/resdac.umn.edu/files/CMS%20Type%20of%20Service%20Table.txt"}]}}
|
|
@ -0,0 +1 @@
|
|||
{"resourceType":"ValueSet","id":"nubc-patientdischargestatus","meta":{"versionId":"1","lastUpdated":"2019-12-16T11:55:24.000-05:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>NUBC Patient Discharge Status</h2><div><p>These codes are found in the <a href=\"https://www.cms.gov/Medicare/CMS-Forms/CMS-Forms/CMS-Forms-Items/CMS1196256\">CMS 1450</a> form. See HL7 OID <a href=\"http://www.hl7.org/oid/OID_view.cfm?&Comp_OID=2.16.840.1.113883.6.301.5\">information</a>.</p>\n</div><p>This value set includes codes from the following code systems:</p><ul><li>Include all codes defined in <code>http//www.nubc.org/patient-discharge</code></li></ul></div>"},"url":"http://hl7.org/fhir/us/ValueSet/nubc-patientdischargestatus","version":"0.1.59-DRAFT","name":"NUBCPatientDischargeStatus","title":"NUBC Patient Discharge Status","status":"draft","date":"2019-12-18T00:18:52-05:00","description":"These codes are found in the [CMS 1450](https://www.cms.gov/Medicare/CMS-Forms/CMS-Forms/CMS-Forms-Items/CMS1196256) form. See HL7 OID [information](http://www.hl7.org/oid/OID_view.cfm?&Comp_OID=2.16.840.1.113883.6.301.5).","compose":{"include":[{"system":"http//www.nubc.org/patient-discharge"}]}}
|
|
@ -0,0 +1 @@
|
|||
{"resourceType":"ValueSet","id":"nubc-pointoforiginforadmissionorvisit","meta":{"versionId":"3","lastUpdated":"2019-12-16T09:34:28.000-05:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>NUBC Point of Origin for Admission or Visit Value Set</h2><div><p>These codes are found in the <a href=\"https://www.cms.gov/Medicare/CMS-Forms/CMS-Forms/CMS-Forms-Items/CMS1196256\">CMS 1450</a> form. See HL7 OID <a href=\"http://www.hl7.org/oid/OID_view.cfm?&Comp_OID=2.16.840.1.113883.6.301.4\">information</a>.</p>\n</div><p>This value set includes codes from the following code systems:</p><ul><li>Include all codes defined in <code>https://www.nubc.org/point-of-origin-for-admission-or-visit</code></li></ul></div>"},"url":"http://hl7.org/fhir/us/ValueSet/nubc-pointoforiginforadmissionorvisit","version":"0.1.59-DRAFT","name":"NUBCPointOfOriginForAdmissionOrVisit","title":"NUBC Point of Origin for Admission or Visit Value Set","status":"draft","date":"2019-12-18T00:18:52-05:00","description":"These codes are found in the [CMS 1450](https://www.cms.gov/Medicare/CMS-Forms/CMS-Forms/CMS-Forms-Items/CMS1196256) form. See HL7 OID [information](http://www.hl7.org/oid/OID_view.cfm?&Comp_OID=2.16.840.1.113883.6.301.4).","compose":{"include":[{"system":"https://www.nubc.org/point-of-origin-for-admission-or-visit"}]}}
|
|
@ -0,0 +1 @@
|
|||
{"resourceType":"ValueSet","id":"nubc-prioritytypeofadmissionorvisit","meta":{"versionId":"2","lastUpdated":"2019-12-16T12:55:47.000-05:00"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>NUBC Priority (Type) of Admission or Visit Value Set</h2><div><p>These codes are found in the <a href=\"https://www.cms.gov/Medicare/CMS-Forms/CMS-Forms/CMS-Forms-Items/CMS1196256\">CMS 1450</a> form.</p>\n</div><p>This value set includes codes from the following code systems:</p><ul><li>Include all codes defined in <code>http//www.nubc.org/priority-type-of-admission-or-visit</code></li></ul></div>"},"url":"http://hl7.org/fhir/us/ValueSet/nubc-prioritytypeofadmissionorvisit","version":"0.1.59-DRAFT","name":"NUBCPriorityTypeOfAdmissionOrVisit","title":"NUBC Priority (Type) of Admission or Visit Value Set","status":"draft","date":"2019-12-18T00:18:52-05:00","description":"These codes are found in the [CMS 1450](https://www.cms.gov/Medicare/CMS-Forms/CMS-Forms/CMS-Forms-Items/CMS1196256) form.","compose":{"include":[{"system":"http//www.nubc.org/priority-type-of-admission-or-visit"}]}}
|
|
@ -0,0 +1 @@
|
|||
{"resourceType":"CodeSystem","id":"careplan-category","text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>US Core CarePlan Category Extension Codes</h2><div><p>Set of codes that are needed for implementation of the US-Core profiles. These codes are used as extensions to the FHIR and US Core value sets.</p>\n</div><p>This code system http://hl7.org/fhir/us/core/CodeSystem/careplan-category defines the following codes:</p><table class=\"codes\"><tr><td style=\"white-space:nowrap\"><b>Code</b></td><td><b>Display</b></td><td><b>Definition</b></td></tr><tr><td style=\"white-space:nowrap\">assess-plan<a name=\"careplan-category-assess-plan\"> </a></td><td>Assessment and Plan of Treatment</td><td>The clinical conclusions and assumptions that guide the patient's treatment and the clinical activities formulated for a patient.</td></tr></table></div>"},"url":"http://hl7.org/fhir/us/core/CodeSystem/careplan-category","version":"3.1.0","name":"USCoreCarePlanCategoryExtensionCodes","title":"US Core CarePlan Category Extension Codes","status":"active","date":"2019-12-17T21:39:14+00:00","publisher":"HL7 US Realm Steering Committee","description":"Set of codes that are needed for implementation of the US-Core profiles. These codes are used as extensions to the FHIR and US Core value sets.\n","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"caseSensitive":true,"content":"complete","concept":[{"code":"assess-plan","display":"Assessment and Plan of Treatment","definition":"The clinical conclusions and assumptions that guide the patient's treatment and the clinical activities formulated for a patient."}]}
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1 @@
|
|||
{"resourceType":"CodeSystem","id":"condition-category","text":{"status":"extensions","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>US Core Condition Category Extension Codes</h2><div><p>Set of codes that are needed for implementation of the US-Core profiles. These codes are used as extensions to the FHIR and US Core value sets.</p>\n</div><p><b>Properties</b></p><table class=\"grid\"><tr><td><b>Code</b></td><td><b>URL</b></td><td><b>Description</b></td><td><b>Type</b></td></tr><tr><td>status</td><td>http://hl7.org/fhir/concept-properties#status</td><td>A property that indicates the status of the concept. One of active, experimental, deprecated, retired</td><td>code</td></tr></table><p>This code system http://hl7.org/fhir/us/core/CodeSystem/condition-category defines the following codes:</p><table class=\"codes\"><tr><td style=\"white-space:nowrap\"><b>Code</b></td><td><b>Display</b></td><td><b>Definition</b></td><td><b>Deprecated</b></td><td><b>status</b></td></tr><tr><td style=\"white-space:nowrap\">problem<a name=\"condition-category-problem\"> </a></td><td>Problem</td><td>The patients problems as identified by the provider(s). Items on the provider’s problem list</td><td>Deprecated</td><td>deprecated</td></tr><tr><td style=\"white-space:nowrap\">health-concern<a name=\"condition-category-health-concern\"> </a></td><td>Health Concern</td><td>Additional health concerns from other stakeholders which are outside the provider’s problem list.</td><td/><td/></tr></table></div>"},"url":"http://hl7.org/fhir/us/core/CodeSystem/condition-category","version":"3.1.0","name":"USCoreConditionCategoryExtensionCodes","title":"US Core Condition Category Extension Codes","status":"active","date":"2019-12-17T21:39:14+00:00","publisher":"HL7 US Realm Steering Committee","description":"Set of codes that are needed for implementation of the US-Core profiles. These codes are used as extensions to the FHIR and US Core value sets.\n","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"caseSensitive":true,"content":"complete","property":[{"code":"status","uri":"http://hl7.org/fhir/concept-properties#status","description":"A property that indicates the status of the concept. One of active, experimental, deprecated, retired","type":"code"}],"concept":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/codesystem-replacedby","valueCoding":{"system":"http://terminology.hl7.org/CodeSystem/condition-category","code":"problem-list-item","display":"Problem List Item"}}],"code":"problem","display":"Problem","definition":"The patients problems as identified by the provider(s). Items on the provider’s problem list","property":[{"code":"status","valueCode":"deprecated"}]},{"code":"health-concern","display":"Health Concern","definition":"Additional health concerns from other stakeholders which are outside the provider’s problem list."}]}
|
|
@ -0,0 +1 @@
|
|||
{"resourceType":"CodeSystem","id":"us-core-documentreference-category","text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>US Core DocumentReferences Category Codes</h2><div><p>The US Core DocumentReferences Type Code System is a 'starter set' of categories supported for fetching and storing DocumentReference Resources.</p>\n</div><p>This code system http://hl7.org/fhir/us/core/CodeSystem/us-core-documentreference-category defines the following codes:</p><table class=\"codes\"><tr><td style=\"white-space:nowrap\"><b>Code</b></td><td><b>Display</b></td><td><b>Definition</b></td></tr><tr><td style=\"white-space:nowrap\">clinical-note<a name=\"us-core-documentreference-category-clinical-note\"> </a></td><td>Clinical Note</td><td>Part of health record where healthcare professionals record details to document a patient's clinical status or achievements during the course of a hospitalization or over the course of outpatient care ([Wikipedia](https://en.wikipedia.org/wiki/Progress_note))</td></tr></table></div>"},"url":"http://hl7.org/fhir/us/core/CodeSystem/us-core-documentreference-category","version":"3.1.0","name":"USCoreDocumentReferencesCategoryCodes","title":"US Core DocumentReferences Category Codes","status":"active","date":"2019-05-21T00:00:00+00:00","description":"The US Core DocumentReferences Type Code System is a 'starter set' of categories supported for fetching and storing DocumentReference Resources.","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"caseSensitive":true,"valueSet":"http://hl7.org/fhir/us/core/ValueSet/us-core-documentreference-category","content":"complete","count":2,"concept":[{"code":"clinical-note","display":"Clinical Note","definition":"Part of health record where healthcare professionals record details to document a patient's clinical status or achievements during the course of a hospitalization or over the course of outpatient care ([Wikipedia](https://en.wikipedia.org/wiki/Progress_note))"}]}
|
|
@ -0,0 +1 @@
|
|||
{"resourceType":"CodeSystem","id":"us-core-provenance-participant-type","text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>US Core Provenance Participant Type Extension Codes</h2><div><p>Set of codes that are needed for implementation of the US-Core profiles. These codes are used as extensions to the FHIR and US Core value sets.</p>\n</div><p>This code system http://hl7.org/fhir/us/core/CodeSystem/us-core-provenance-participant-type defines the following codes:</p><table class=\"codes\"><tr><td style=\"white-space:nowrap\"><b>Code</b></td><td><b>Display</b></td><td><b>Definition</b></td></tr><tr><td style=\"white-space:nowrap\">transmitter<a name=\"us-core-provenance-participant-type-transmitter\"> </a></td><td>Transmitter</td><td>The entity that provided the copy to your system.</td></tr></table></div>"},"url":"http://hl7.org/fhir/us/core/CodeSystem/us-core-provenance-participant-type","version":"3.1.0","name":"USCoreProvenancePaticipantTypeExtensionCodes","title":"US Core Provenance Participant Type Extension Codes","status":"active","date":"2019-12-17T21:39:14+00:00","publisher":"HL7 US Realm Steering Committee","description":"Set of codes that are needed for implementation of the US-Core profiles. These codes are used as extensions to the FHIR and US Core value sets.\n","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"caseSensitive":true,"content":"complete","concept":[{"code":"transmitter","display":"Transmitter","definition":"The entity that provided the copy to your system."}]}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,69 @@
|
|||
{
|
||||
"resourceType": "ValueSet",
|
||||
"id": "birthsex",
|
||||
"text": {
|
||||
"status": "generated",
|
||||
"div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>Birth Sex</h2><div><p>Codes for assigning sex at birth as specified by the <a href=\"https://www.healthit.gov/newsroom/about-onc\">Office of the National Coordinator for Health IT (ONC)</a></p>\n</div><p>This value set includes codes from the following code systems:</p><ul><li>Include these codes as defined in <a href=\"http://hl7.org/fhir/R4/v3/AdministrativeGender/cs.html\"><code>http://terminology.hl7.org/CodeSystem/v3-AdministrativeGender</code></a><table class=\"none\"><tr><td style=\"white-space:nowrap\"><b>Code</b></td><td><b>Display</b></td></tr><tr><td><a href=\"http://hl7.org/fhir/R4/v3/AdministrativeGender/cs.html#v3-AdministrativeGender-F\">F</a></td><td>Female</td><td>Female</td></tr><tr><td><a href=\"http://hl7.org/fhir/R4/v3/AdministrativeGender/cs.html#v3-AdministrativeGender-M\">M</a></td><td>Male</td><td>Male</td></tr></table></li><li>Include these codes as defined in <a href=\"http://hl7.org/fhir/R4/v3/NullFlavor/cs.html\"><code>http://terminology.hl7.org/CodeSystem/v3-NullFlavor</code></a><table class=\"none\"><tr><td style=\"white-space:nowrap\"><b>Code</b></td><td><b>Display</b></td></tr><tr><td><a href=\"http://hl7.org/fhir/R4/v3/NullFlavor/cs.html#v3-NullFlavor-UNK\">UNK</a></td><td>Unknown</td><td>Description:A proper value is applicable, but not known.<br/>\n \n Usage Notes: This means the actual value is not known. If the only thing that is unknown is how to properly express the value in the necessary constraints (value set, datatype, etc.), then the OTH or UNC flavor should be used. No properties should be included for a datatype with this property unless:<br/>\n \n Those properties themselves directly translate to a semantic of "unknown". (E.g. a local code sent as a translation that conveys 'unknown')\n Those properties further qualify the nature of what is unknown. (E.g. specifying a use code of "H" and a URL prefix of "tel:" to convey that it is the home phone number that is unknown.)</td></tr></table></li></ul></div>"
|
||||
},
|
||||
"url": "http://hl7.org/fhir/us/core/ValueSet/birthsex",
|
||||
"identifier": [
|
||||
{
|
||||
"system": "urn:ietf:rfc:3986",
|
||||
"value": "urn:oid:2.16.840.1.113762.1.4.1021.24"
|
||||
}
|
||||
],
|
||||
"version": "3.1.0",
|
||||
"name": "BirthSex",
|
||||
"title": "Birth Sex",
|
||||
"status": "active",
|
||||
"date": "2019-05-21T00:00:00+00:00",
|
||||
"publisher": "HL7 US Realm Steering Committee",
|
||||
"contact": [
|
||||
{
|
||||
"telecom": [
|
||||
{
|
||||
"system": "other",
|
||||
"value": "http://hl7.org/fhir"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"description": "Codes for assigning sex at birth as specified by the [Office of the National Coordinator for Health IT (ONC)](https://www.healthit.gov/newsroom/about-onc)",
|
||||
"jurisdiction": [
|
||||
{
|
||||
"coding": [
|
||||
{
|
||||
"system": "urn:iso:std:iso:3166",
|
||||
"code": "US",
|
||||
"display": "United States of America"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"compose": {
|
||||
"include": [
|
||||
{
|
||||
"system": "http://terminology.hl7.org/CodeSystem/v3-AdministrativeGender",
|
||||
"concept": [
|
||||
{
|
||||
"code": "F",
|
||||
"display": "Female"
|
||||
},
|
||||
{
|
||||
"code": "M",
|
||||
"display": "Male"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"system": "http://terminology.hl7.org/CodeSystem/v3-NullFlavor",
|
||||
"concept": [
|
||||
{
|
||||
"code": "UNK",
|
||||
"display": "Unknown"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
{"resourceType":"ValueSet","id":"detailed-ethnicity","text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>Detailed ethnicity</h2><div><p>The 41 <a href=\"http://www.cdc.gov/phin/resources/vocabulary/index.html\">CDC ethnicity codes</a> that are grouped under one of the 2 OMB ethnicity category codes.</p>\n</div><p>This value set includes codes from the following code systems:</p><ul><li>Include codes from <a href=\"CodeSystem-cdcrec.html\"><code>urn:oid:2.16.840.1.113883.6.238</code></a> where concept is-a <a href=\"CodeSystem-cdcrec.html#cdcrec-2133-7\">2133-7</a></li><li>Exclude these codes as defined in <a href=\"CodeSystem-cdcrec.html\"><code>urn:oid:2.16.840.1.113883.6.238</code></a><table class=\"none\"><tr><td style=\"white-space:nowrap\"><b>Code</b></td><td><b>Display</b></td></tr><tr><td><a href=\"CodeSystem-cdcrec.html#cdcrec-2135-2\">2135-2</a></td><td>Hispanic or Latino</td><td>Hispanic or Latino</td></tr><tr><td><a href=\"CodeSystem-cdcrec.html#cdcrec-2186-5\">2186-5</a></td><td>Not Hispanic or Latino</td><td>Note that this term remains in the table for completeness, even though within HL7, the notion of "not otherwise coded" term is deprecated.</td></tr></table></li></ul></div>"},"url":"http://hl7.org/fhir/us/core/ValueSet/detailed-ethnicity","version":"3.1.0","name":"DetailedEthnicity","title":"Detailed ethnicity","status":"active","date":"2019-05-21T00:00:00+00:00","publisher":"HL7 US Realm Steering Committee","description":"The 41 [CDC ethnicity codes](http://www.cdc.gov/phin/resources/vocabulary/index.html) that are grouped under one of the 2 OMB ethnicity category codes.","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"compose":{"include":[{"system":"urn:oid:2.16.840.1.113883.6.238","filter":[{"property":"concept","op":"is-a","value":"2133-7"}]}],"exclude":[{"system":"urn:oid:2.16.840.1.113883.6.238","concept":[{"code":"2135-2"},{"code":"2186-5"}]}]}}
|
|
@ -0,0 +1 @@
|
|||
{"resourceType":"ValueSet","id":"detailed-race","text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>Detailed Race</h2><div><p>The 900+ <a href=\"http://www.cdc.gov/phin/resources/vocabulary/index.html\">CDC Race codes</a> that are grouped under one of the 5 OMB race category codes.</p>\n</div><p>This value set includes codes from the following code systems:</p><ul><li>Include codes from <a href=\"CodeSystem-cdcrec.html\"><code>urn:oid:2.16.840.1.113883.6.238</code></a> where concept is-a <a href=\"CodeSystem-cdcrec.html#cdcrec-1000-9\">1000-9</a></li><li>Exclude these codes as defined in <a href=\"CodeSystem-cdcrec.html\"><code>urn:oid:2.16.840.1.113883.6.238</code></a><table class=\"none\"><tr><td style=\"white-space:nowrap\"><b>Code</b></td><td><b>Display</b></td></tr><tr><td><a href=\"CodeSystem-cdcrec.html#cdcrec-1002-5\">1002-5</a></td><td>American Indian or Alaska Native</td><td>American Indian or Alaska Native</td></tr><tr><td><a href=\"CodeSystem-cdcrec.html#cdcrec-2028-9\">2028-9</a></td><td>Asian</td><td>Asian</td></tr><tr><td><a href=\"CodeSystem-cdcrec.html#cdcrec-2054-5\">2054-5</a></td><td>Black or African American</td><td>Black or African American</td></tr><tr><td><a href=\"CodeSystem-cdcrec.html#cdcrec-2076-8\">2076-8</a></td><td>Native Hawaiian or Other Pacific Islander</td><td>Native Hawaiian or Other Pacific Islander</td></tr><tr><td><a href=\"CodeSystem-cdcrec.html#cdcrec-2106-3\">2106-3</a></td><td>White</td><td>White</td></tr></table></li></ul></div>"},"url":"http://hl7.org/fhir/us/core/ValueSet/detailed-race","version":"3.1.0","name":"DetailedRace","title":"Detailed Race","status":"active","date":"2019-05-21T00:00:00+00:00","publisher":"HL7 US Realm Steering Committee","description":"The 900+ [CDC Race codes](http://www.cdc.gov/phin/resources/vocabulary/index.html) that are grouped under one of the 5 OMB race category codes.","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"compose":{"include":[{"system":"urn:oid:2.16.840.1.113883.6.238","filter":[{"property":"concept","op":"is-a","value":"1000-9"}]}],"exclude":[{"system":"urn:oid:2.16.840.1.113883.6.238","concept":[{"code":"1002-5"},{"code":"2028-9"},{"code":"2054-5"},{"code":"2076-8"},{"code":"2106-3"}]}]}}
|
|
@ -0,0 +1 @@
|
|||
{"resourceType":"ValueSet","id":"omb-ethnicity-category","text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>OMB Ethnicity Categories</h2><div><p>The codes for the ethnicity categories - 'Hispanic or Latino' and 'Non Hispanic or Latino' - as defined by the <a href=\"https://www.whitehouse.gov/omb/fedreg_1997standards\">OMB Standards for Maintaining, Collecting, and Presenting Federal Data on Race and Ethnicity, Statistical Policy Directive No. 15, as revised, October 30, 1997</a>.</p>\n</div><p>This value set includes codes from the following code systems:</p><ul><li>Include these codes as defined in <a href=\"CodeSystem-cdcrec.html\"><code>urn:oid:2.16.840.1.113883.6.238</code></a><table class=\"none\"><tr><td style=\"white-space:nowrap\"><b>Code</b></td><td><b>Display</b></td></tr><tr><td><a href=\"CodeSystem-cdcrec.html#cdcrec-2135-2\">2135-2</a></td><td>Hispanic or Latino</td><td>Hispanic or Latino</td></tr><tr><td><a href=\"CodeSystem-cdcrec.html#cdcrec-2186-5\">2186-5</a></td><td>Non Hispanic or Latino</td><td>Note that this term remains in the table for completeness, even though within HL7, the notion of "not otherwise coded" term is deprecated.</td></tr></table></li></ul></div>"},"url":"http://hl7.org/fhir/us/core/ValueSet/omb-ethnicity-category","version":"3.1.0","name":"OmbEthnicityCategories","title":"OMB Ethnicity Categories","status":"active","date":"2019-05-21T00:00:00+00:00","publisher":"HL7 US Realm Steering Committee","description":"The codes for the ethnicity categories - 'Hispanic or Latino' and 'Non Hispanic or Latino' - as defined by the [OMB Standards for Maintaining, Collecting, and Presenting Federal Data on Race and Ethnicity, Statistical Policy Directive No. 15, as revised, October 30, 1997](https://www.whitehouse.gov/omb/fedreg_1997standards).","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"compose":{"include":[{"system":"urn:oid:2.16.840.1.113883.6.238","concept":[{"code":"2135-2","display":"Hispanic or Latino"},{"code":"2186-5","display":"Non Hispanic or Latino"}]}]}}
|
|
@ -0,0 +1 @@
|
|||
{"resourceType":"ValueSet","id":"omb-race-category","text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>OMB Race Categories</h2><div><p>The codes for the concepts 'Unknown' and 'Asked but no answer' and the the codes for the five race categories - 'American Indian' or 'Alaska Native', 'Asian', 'Black or African American', 'Native Hawaiian or Other Pacific Islander', and 'White' - as defined by the <a href=\"https://www.whitehouse.gov/omb/fedreg_1997standards\">OMB Standards for Maintaining, Collecting, and Presenting Federal Data on Race and Ethnicity, Statistical Policy Directive No. 15, as revised, October 30, 1997</a> .</p>\n</div><p>This value set includes codes from the following code systems:</p><ul><li>Include these codes as defined in <a href=\"CodeSystem-cdcrec.html\"><code>urn:oid:2.16.840.1.113883.6.238</code></a><table class=\"none\"><tr><td style=\"white-space:nowrap\"><b>Code</b></td><td><b>Display</b></td></tr><tr><td><a href=\"CodeSystem-cdcrec.html#cdcrec-1002-5\">1002-5</a></td><td>American Indian or Alaska Native</td><td>American Indian or Alaska Native</td></tr><tr><td><a href=\"CodeSystem-cdcrec.html#cdcrec-2028-9\">2028-9</a></td><td>Asian</td><td>Asian</td></tr><tr><td><a href=\"CodeSystem-cdcrec.html#cdcrec-2054-5\">2054-5</a></td><td>Black or African American</td><td>Black or African American</td></tr><tr><td><a href=\"CodeSystem-cdcrec.html#cdcrec-2076-8\">2076-8</a></td><td>Native Hawaiian or Other Pacific Islander</td><td>Native Hawaiian or Other Pacific Islander</td></tr><tr><td><a href=\"CodeSystem-cdcrec.html#cdcrec-2106-3\">2106-3</a></td><td>White</td><td>White</td></tr></table></li><li>Include these codes as defined in <a href=\"http://hl7.org/fhir/R4/v3/NullFlavor/cs.html\"><code>http://terminology.hl7.org/CodeSystem/v3-NullFlavor</code></a><table class=\"none\"><tr><td style=\"white-space:nowrap\"><b>Code</b></td><td><b>Display</b></td></tr><tr><td><a href=\"http://hl7.org/fhir/R4/v3/NullFlavor/cs.html#v3-NullFlavor-UNK\">UNK</a></td><td>Unknown</td><td>Description:A proper value is applicable, but not known.<br/>\n \n Usage Notes: This means the actual value is not known. If the only thing that is unknown is how to properly express the value in the necessary constraints (value set, datatype, etc.), then the OTH or UNC flavor should be used. No properties should be included for a datatype with this property unless:<br/>\n \n Those properties themselves directly translate to a semantic of "unknown". (E.g. a local code sent as a translation that conveys 'unknown')\n Those properties further qualify the nature of what is unknown. (E.g. specifying a use code of "H" and a URL prefix of "tel:" to convey that it is the home phone number that is unknown.)</td></tr><tr><td><a href=\"http://hl7.org/fhir/R4/v3/NullFlavor/cs.html#v3-NullFlavor-ASKU\">ASKU</a></td><td>Asked but no answer</td><td>Information was sought but not found (e.g., patient was asked but didn't know)</td></tr></table></li></ul></div>"},"url":"http://hl7.org/fhir/us/core/ValueSet/omb-race-category","identifier":[{"system":"urn:ietf:rfc:3986","value":"urn:oid:2.16.840.1.113883.4.642.2.575"}],"version":"3.1.0","name":"OmbRaceCategories","title":"OMB Race Categories","status":"active","date":"2019-05-21T00:00:00+00:00","publisher":"HL7 US Realm Steering Committee","contact":[{"telecom":[{"system":"other","value":"http://hl7.org/fhir"}]},{"telecom":[{"system":"other","value":"http://wiki.siframework.org/Data+Access+Framework+Homepage"}]}],"description":"The codes for the concepts 'Unknown' and 'Asked but no answer' and the the codes for the five race categories - 'American Indian' or 'Alaska Native', 'Asian', 'Black or African American', 'Native Hawaiian or Other Pacific Islander', and 'White' - as defined by the [OMB Standards for Maintaining, Collecting, and Presenting Federal Data on Race and Ethnicity, Statistical Policy Directive No. 15, as revised, October 30, 1997](https://www.whitehouse.gov/omb/fedreg_1997standards) .","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"compose":{"include":[{"system":"urn:oid:2.16.840.1.113883.6.238","concept":[{"code":"1002-5","display":"American Indian or Alaska Native"},{"code":"2028-9","display":"Asian"},{"code":"2054-5","display":"Black or African American"},{"code":"2076-8","display":"Native Hawaiian or Other Pacific Islander"},{"code":"2106-3","display":"White"}]},{"system":"http://terminology.hl7.org/CodeSystem/v3-NullFlavor","concept":[{"code":"UNK","display":"Unknown"},{"code":"ASKU","display":"Asked but no answer"}]}]}}
|
|
@ -0,0 +1 @@
|
|||
{"resourceType":"ValueSet","id":"simple-language","text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>Language codes with language and optionally a region modifier</h2><div><p>This value set includes codes from <a href=\"http://tools.ietf.org/html/bcp47\">BCP-47</a>. This value set matches the ONC 2015 Edition LanguageCommunication data element value set within C-CDA to use a 2 character language code if one exists, and a 3 character code if a 2 character code does not exist. It points back to <a href=\"https://tools.ietf.org/html/rfc5646\">RFC 5646</a>, however only the language codes are required, all other elements are optional.</p>\n</div><p>This value set includes codes from the following code systems:</p><ul><li>Include codes from <code>urn:ietf:bcp:47</code> where ext-lang doesn't exist, script doesn't exist, variant doesn't exist, extension doesn't exist and private-use doesn't exist</li></ul></div>"},"url":"http://hl7.org/fhir/us/core/ValueSet/simple-language","version":"3.1.0","name":"LanguageCodesWithLanguageAndOptionallyARegionModifier","title":"Language codes with language and optionally a region modifier","status":"active","date":"2019-05-21T00:00:00+00:00","publisher":"HL7 US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://hl7.org/fhir"}]}],"description":"This value set includes codes from [BCP-47](http://tools.ietf.org/html/bcp47). This value set matches the ONC 2015 Edition LanguageCommunication data element value set within C-CDA to use a 2 character language code if one exists, and a 3 character code if a 2 character code does not exist. It points back to [RFC 5646](https://tools.ietf.org/html/rfc5646), however only the language codes are required, all other elements are optional.","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"compose":{"include":[{"system":"urn:ietf:bcp:47","filter":[{"property":"ext-lang","op":"exists","value":"false"},{"property":"script","op":"exists","value":"false"},{"property":"variant","op":"exists","value":"false"},{"property":"extension","op":"exists","value":"false"},{"property":"private-use","op":"exists","value":"false"}]}]}}
|
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue