Skip to content

Commit

Permalink
issue #3650 - specify target version for more 1.0.0 artifacts
Browse files Browse the repository at this point in the history
1. update StructureDefinition artifacts to specify that the plannet
extensions referenced from 1.0.0 profiles should be the 1.0.0 version of
the extension definitions

2. update StructureDefinition artifacts to specify that plannet code
systems referenced from 1.0.0 valuesets should be the 1.0.0 version of
those code systems

3. fix the ConstraintGeneratorTest to specify the version of artifacts
to generate constraints from (previously it would always use the
"latest" vesion, even for the test that was supposed to execute against
the 1.0.0 artifacts)

Signed-off-by: Lee Surprenant <lmsurpre@merative.com>
  • Loading branch information
lmsurpre committed Sep 2, 2022
1 parent fa544f8 commit 45dafbc
Show file tree
Hide file tree
Showing 26 changed files with 96 additions and 37 deletions.
2 changes: 2 additions & 0 deletions conformance/fhir-ig-davinci-pdex-plan-net/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Corresponding to https://github.com/HL7/davinci-pdex-plan-net/commit/2c561128f86
- Stripped narrative text to reduce the size and formatted the JSON contents (both via the ResourceProcessor tool)
- Added version id to each targetProfile canonical reference (e.g. `http://hl7.org/fhir/us/davinci-pdex-plan-net/StructureDefinition/plannet-Organization` -> `http://hl7.org/fhir/us/davinci-pdex-plan-net/StructureDefinition/plannet-Organization|1.0.0`)
- Added version id to each valueSet binding target (e.g. `http://hl7.org/fhir/us/davinci-pdex-plan-net/ValueSet/InsuranceProductTypeVS` -> `http://hl7.org/fhir/us/davinci-pdex-plan-net/ValueSet/InsuranceProductTypeVS|1.0.0`)
- Added version id to each extension's profile reference in each StructureDefinition
- Added version element to each CodeSystem reference from each ValueSet definition

Note: the examples were subsequently retrieved from http://hl7.org/fhir/us/davinci-pdex-plan-net/STU1/package.tgz on May 19, 2022.
- Added version id to the Meta.profile entry for each example
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@
{
"code": "Extension",
"profile": [
"http://hl7.org/fhir/us/davinci-pdex-plan-net/StructureDefinition/endpoint-usecase"
"http://hl7.org/fhir/us/davinci-pdex-plan-net/StructureDefinition/endpoint-usecase|1.0.0"
]
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@
{
"code": "Extension",
"profile": [
"http://hl7.org/fhir/us/davinci-pdex-plan-net/StructureDefinition/newpatients"
"http://hl7.org/fhir/us/davinci-pdex-plan-net/StructureDefinition/newpatients|1.0.0"
]
}
],
Expand Down Expand Up @@ -785,7 +785,7 @@
{
"code": "Extension",
"profile": [
"http://hl7.org/fhir/us/davinci-pdex-plan-net/StructureDefinition/delivery-method"
"http://hl7.org/fhir/us/davinci-pdex-plan-net/StructureDefinition/delivery-method|1.0.0"
]
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@
{
"code": "Extension",
"profile": [
"http://hl7.org/fhir/us/davinci-pdex-plan-net/StructureDefinition/newpatients"
"http://hl7.org/fhir/us/davinci-pdex-plan-net/StructureDefinition/newpatients|1.0.0"
]
}
],
Expand Down Expand Up @@ -785,7 +785,7 @@
{
"code": "Extension",
"profile": [
"http://hl7.org/fhir/us/davinci-pdex-plan-net/StructureDefinition/accessibility"
"http://hl7.org/fhir/us/davinci-pdex-plan-net/StructureDefinition/accessibility|1.0.0"
]
}
],
Expand Down Expand Up @@ -841,7 +841,7 @@
{
"code": "Extension",
"profile": [
"http://hl7.org/fhir/StructureDefinition/location-boundary-geojson"
"http://hl7.org/fhir/StructureDefinition/location-boundary-geojson|1.0.0"
]
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@
{
"code": "Extension",
"profile": [
"http://hl7.org/fhir/us/davinci-pdex-plan-net/StructureDefinition/location-reference"
"http://hl7.org/fhir/us/davinci-pdex-plan-net/StructureDefinition/location-reference|1.0.0"
]
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@
{
"code": "Extension",
"profile": [
"http://hl7.org/fhir/us/davinci-pdex-plan-net/StructureDefinition/qualification"
"http://hl7.org/fhir/us/davinci-pdex-plan-net/StructureDefinition/qualification|1.0.0"
]
}
],
Expand Down Expand Up @@ -805,7 +805,7 @@
{
"code": "Extension",
"profile": [
"http://hl7.org/fhir/us/davinci-pdex-plan-net/StructureDefinition/org-description"
"http://hl7.org/fhir/us/davinci-pdex-plan-net/StructureDefinition/org-description|1.0.0"
]
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@
{
"code": "Extension",
"profile": [
"http://hl7.org/fhir/us/davinci-pdex-plan-net/StructureDefinition/qualification"
"http://hl7.org/fhir/us/davinci-pdex-plan-net/StructureDefinition/qualification|1.0.0"
]
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@
{
"code": "Extension",
"profile": [
"http://hl7.org/fhir/us/davinci-pdex-plan-net/StructureDefinition/newpatients"
"http://hl7.org/fhir/us/davinci-pdex-plan-net/StructureDefinition/newpatients|1.0.0"
]
}
],
Expand Down Expand Up @@ -810,7 +810,7 @@
{
"code": "Extension",
"profile": [
"http://hl7.org/fhir/us/davinci-pdex-plan-net/StructureDefinition/network-reference"
"http://hl7.org/fhir/us/davinci-pdex-plan-net/StructureDefinition/network-reference|1.0.0"
]
}
],
Expand Down Expand Up @@ -865,7 +865,7 @@
{
"code": "Extension",
"profile": [
"http://hl7.org/fhir/us/davinci-pdex-plan-net/StructureDefinition/qualification"
"http://hl7.org/fhir/us/davinci-pdex-plan-net/StructureDefinition/qualification|1.0.0"
]
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
"compose": {
"include": [
{
"system": "http://hl7.org/fhir/us/davinci-pdex-plan-net/CodeSystem/AcceptingPatientsCS"
"system": "http://hl7.org/fhir/us/davinci-pdex-plan-net/CodeSystem/AcceptingPatientsCS",
"version": "1.0.0"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
"compose": {
"include": [
{
"system": "http://hl7.org/fhir/us/davinci-pdex-plan-net/CodeSystem/AccessibilityCS"
"system": "http://hl7.org/fhir/us/davinci-pdex-plan-net/CodeSystem/AccessibilityCS",
"version": "1.0.0"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
"compose": {
"include": [
{
"system": "http://hl7.org/fhir/us/davinci-pdex-plan-net/CodeSystem/DeliveryMethodCS"
"system": "http://hl7.org/fhir/us/davinci-pdex-plan-net/CodeSystem/DeliveryMethodCS",
"version": "1.0.0"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@
"system": "http://terminology.hl7.org/CodeSystem/endpoint-connection-type"
},
{
"system": "http://hl7.org/fhir/us/davinci-pdex-plan-net/CodeSystem/EndpointConnectionTypeCS"
"system": "http://hl7.org/fhir/us/davinci-pdex-plan-net/CodeSystem/EndpointConnectionTypeCS",
"version": "1.0.0"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"include": [
{
"system": "http://hl7.org/fhir/us/davinci-pdex-plan-net/CodeSystem/EndpointPayloadTypeCS",
"version": "1.0.0",
"concept": [
{
"code": "NA",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
"compose": {
"include": [
{
"system": "http://hl7.org/fhir/us/davinci-pdex-plan-net/CodeSystem/HealthcareServiceCategoryCS"
"system": "http://hl7.org/fhir/us/davinci-pdex-plan-net/CodeSystem/HealthcareServiceCategoryCS",
"version": "1.0.0"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
"compose": {
"include": [
{
"system": "http://hl7.org/fhir/us/davinci-pdex-plan-net/CodeSystem/InsurancePlanTypeCS"
"system": "http://hl7.org/fhir/us/davinci-pdex-plan-net/CodeSystem/InsurancePlanTypeCS",
"version": "1.0.0"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
"compose": {
"include": [
{
"system": "http://hl7.org/fhir/us/davinci-pdex-plan-net/CodeSystem/InsuranceProductTypeCS"
"system": "http://hl7.org/fhir/us/davinci-pdex-plan-net/CodeSystem/InsuranceProductTypeCS",
"version": "1.0.0"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
"compose": {
"include": [
{
"system": "http://hl7.org/fhir/us/davinci-pdex-plan-net/CodeSystem/LanguageProficiencyCS"
"system": "http://hl7.org/fhir/us/davinci-pdex-plan-net/CodeSystem/LanguageProficiencyCS",
"version": "1.0.0"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
},
{
"system": "http://hl7.org/fhir/us/davinci-pdex-plan-net/CodeSystem/EndpointConnectionTypeCS",
"version": "1.0.0",
"concept": [
{
"code": "hl7-fhir-opn",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"include": [
{
"system": "http://hl7.org/fhir/us/davinci-pdex-plan-net/CodeSystem/OrgTypeCS",
"version": "1.0.0",
"concept": [
{
"code": "ntwk"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,14 @@
"compose": {
"include": [
{
"system": "http://hl7.org/fhir/us/davinci-pdex-plan-net/CodeSystem/OrgTypeCS"
"system": "http://hl7.org/fhir/us/davinci-pdex-plan-net/CodeSystem/OrgTypeCS",
"version": "1.0.0"
}
],
"exclude": [
{
"system": "http://hl7.org/fhir/us/davinci-pdex-plan-net/CodeSystem/OrgTypeCS",
"version": "1.0.0",
"concept": [
{
"code": "ntwk"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@
"system": "http://hl7.org/fhir/organization-role"
},
{
"system": "http://hl7.org/fhir/us/davinci-pdex-plan-net/CodeSystem/OrganizationAffiliationRoleCS"
"system": "http://hl7.org/fhir/us/davinci-pdex-plan-net/CodeSystem/OrganizationAffiliationRoleCS",
"version": "1.0.0"
}
],
"exclude": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
"compose": {
"include": [
{
"system": "http://hl7.org/fhir/us/davinci-pdex-plan-net/CodeSystem/ProviderRoleCS"
"system": "http://hl7.org/fhir/us/davinci-pdex-plan-net/CodeSystem/ProviderRoleCS",
"version": "1.0.0"
},
{
"system": "http://terminology.hl7.org/CodeSystem/practitioner-role"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
"compose": {
"include": [
{
"system": "http://hl7.org/fhir/us/davinci-pdex-plan-net/CodeSystem/QualificationStatusCS"
"system": "http://hl7.org/fhir/us/davinci-pdex-plan-net/CodeSystem/QualificationStatusCS",
"version": "1.0.0"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
"compose": {
"include": [
{
"system": "http://hl7.org/fhir/us/davinci-pdex-plan-net/CodeSystem/VirtualModalitiesCS"
"system": "http://hl7.org/fhir/us/davinci-pdex-plan-net/CodeSystem/VirtualModalitiesCS",
"version": "1.0.0"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2020
* (C) Copyright IBM Corp. 2020, 2022
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand All @@ -8,8 +8,6 @@

import static org.linuxforhealth.fhir.path.util.FHIRPathUtil.compile;

import org.testng.annotations.Test;

import org.linuxforhealth.fhir.ig.davinci.pdex.plannet.PlanNet100ResourceProvider;
import org.linuxforhealth.fhir.ig.davinci.pdex.plannet.PlanNet110ResourceProvider;
import org.linuxforhealth.fhir.model.annotation.Constraint;
Expand All @@ -19,18 +17,26 @@
import org.linuxforhealth.fhir.profile.ProfileSupport;
import org.linuxforhealth.fhir.registry.resource.FHIRRegistryResource;
import org.linuxforhealth.fhir.registry.spi.FHIRRegistryResourceProvider;
import org.testng.annotations.Test;

public class ConstraintGeneratorTest {
private static boolean DEBUG = true;

@Test
public static void test100ConstraintGenerator() throws Exception {
FHIRRegistryResourceProvider provider = new PlanNet100ResourceProvider();
for (FHIRRegistryResource registryResource : provider.getRegistryResources()) {
if (StructureDefinition.class.equals(registryResource.getResourceType())) {
String url = registryResource.getUrl();
System.out.println(url);
String version = registryResource.getVersion().toString();
if (DEBUG) {
System.out.println(url);
}
Class<?> type = ModelSupport.isResourceType(registryResource.getType()) ? ModelSupport.getResourceType(registryResource.getType()) : Extension.class;
for (Constraint constraint : ProfileSupport.getConstraints(url, type)) {
System.out.println(" " + constraint);
for (Constraint constraint : ProfileSupport.getConstraints(url + "|" + version, type)) {
if (DEBUG) {
System.out.println(" " + constraint);
}
if (!Constraint.LOCATION_BASE.equals(constraint.location())) {
compile(constraint.location());
}
Expand All @@ -46,10 +52,15 @@ public static void test110ConstraintGenerator() throws Exception {
for (FHIRRegistryResource registryResource : provider.getRegistryResources()) {
if (StructureDefinition.class.equals(registryResource.getResourceType())) {
String url = registryResource.getUrl();
System.out.println(url);
String version = registryResource.getVersion().toString();
if (DEBUG) {
System.out.println(url);
}
Class<?> type = ModelSupport.isResourceType(registryResource.getType()) ? ModelSupport.getResourceType(registryResource.getType()) : Extension.class;
for (Constraint constraint : ProfileSupport.getConstraints(url, type)) {
System.out.println(" " + constraint);
for (Constraint constraint : ProfileSupport.getConstraints(url + "|" + version, type)) {
if (DEBUG) {
System.out.println(" " + constraint);
}
if (!Constraint.LOCATION_BASE.equals(constraint.location())) {
compile(constraint.location());
}
Expand Down
Loading

0 comments on commit 45dafbc

Please sign in to comment.