@@ -112,27 +112,31 @@ public static List<Bundle.BundleEntryComponent> transformImportBundle(
112112 switch (resource .getResourceType ()) {
113113 case ValueSet :
114114 var valueSet = (ValueSet ) resource ;
115- List <UsageContext > conditionsList = new ArrayList <>();
115+ List <UsageContext > genericContextList = new ArrayList <>();
116116 List <UsageContext > priorityList = new ArrayList <>();
117117 valueSet .setIdentifier (fixIdentifiers (valueSet .getIdentifier ()));
118118 var valueSetCanonicalUrl = adapterFactory
119119 .createKnowledgeArtifactAdapter (valueSet )
120120 .getCanonical ();
121- extractPrioritiesAndConditions (
122- valueSet .getUseContext (), priorityList , conditionsList , valueSetCanonicalUrl );
121+ extractUsageContexts (
122+ valueSet .getUseContext (), priorityList , genericContextList , valueSetCanonicalUrl );
123123 if (hasGrouperCompose (valueSet )) {
124124 prepareGrouperValueSet (valueSet , appAuthoritativeUrl );
125- groupers .add (
126- relatedArtifactFromGrouperUrl ( valueSetCanonicalUrl , conditionsList , priorityList ));
125+ groupers .add (relatedArtifactFromGrouperUrl (
126+ valueSetCanonicalUrl , genericContextList , priorityList ));
127127 } else {
128128 prepareLeafValueSet (valueSet );
129- leafs .add (relatedArtifactFromLeafUrl (valueSetCanonicalUrl , conditionsList , priorityList ));
129+ leafs .add (
130+ relatedArtifactFromLeafUrl (valueSetCanonicalUrl , genericContextList , priorityList ));
130131 }
131132 // Remove conditions and priority from useContext of leaf valuesets and groupers
132133 var cleanedContext = valueSet .getUseContext ().stream ()
133134 .filter (ctx -> ctx .hasCode ()
134- && !(ctx .getCode ().getCode ().equals ("focus" )
135- || ctx .getCode ().getCode ().equals ("priority" )))
135+ && !(ctx .getCode ().getCode ().equals ("focus" )
136+ || ctx .getCode ()
137+ .getCode ()
138+ .equals ("priority" ))
139+ || ctx .getCode ().getCode ().equals ("reporting" ))
136140 .collect (Collectors .toList ());
137141 valueSet .setUseContext (cleanedContext );
138142 // Check if ValueSet already exists
@@ -249,10 +253,10 @@ static List<CanonicalType> removeProfileFromList(List<CanonicalType> profiles, S
249253 .collect (Collectors .toList ());
250254 }
251255
252- static void extractPrioritiesAndConditions (
256+ static void extractUsageContexts (
253257 List <UsageContext > contexts ,
254258 List <UsageContext > priorityList ,
255- List <UsageContext > conditionsList ,
259+ List <UsageContext > genericContextList ,
256260 String valueSetCanonicalUrl ) {
257261
258262 if (contexts == null || contexts .isEmpty ()) return ;
@@ -262,7 +266,7 @@ static void extractPrioritiesAndConditions(
262266 if (!isValidUsageContext ) continue ;
263267
264268 switch (context .getCode ().getCode ()) {
265- case "focus" -> conditionsList .add (context );
269+ case "focus" , "reporting" -> genericContextList .add (context );
266270 case "priority" -> handlePriorityContext (context , priorityList , valueSetCanonicalUrl );
267271 default -> {
268272 /* ignore other usage contexts */
@@ -360,16 +364,16 @@ private static void prepareRCTCLibrary(Library rctcLibrary, Set<RelatedArtifact>
360364 }
361365
362366 private static RelatedArtifact relatedArtifactFromGrouperUrl (
363- String grouperUrl , List <UsageContext > conditions , List <UsageContext > priorities ) {
367+ String grouperUrl , List <UsageContext > genericContexts , List <UsageContext > priorities ) {
364368 var relatedArtifact = new RelatedArtifact ();
365369 relatedArtifact .setType (RelatedArtifact .RelatedArtifactType .COMPOSEDOF );
366370 relatedArtifact .setResource (grouperUrl );
367371 var isOwnedExtension = new Extension ();
368372 isOwnedExtension .setUrl (TransformProperties .crmiIsOwned );
369373 isOwnedExtension .setValue (new BooleanType (true ));
370374 var extensions = new ArrayList <Extension >();
371- extensions .addAll (
372- processUsageContextMapForLibrary ( conditions , TransformProperties .CRMI_INTENDED_USAGE_CONTEXT_EXT_URL ));
375+ extensions .addAll (processUsageContextMapForLibrary (
376+ genericContexts , TransformProperties .CRMI_INTENDED_USAGE_CONTEXT_EXT_URL ));
373377 extensions .addAll (
374378 processUsageContextMapForLibrary (priorities , TransformProperties .CRMI_INTENDED_USAGE_CONTEXT_EXT_URL ));
375379 extensions .add (isOwnedExtension );
@@ -378,13 +382,13 @@ private static RelatedArtifact relatedArtifactFromGrouperUrl(
378382 }
379383
380384 private static RelatedArtifact relatedArtifactFromLeafUrl (
381- String leafUrl , List <UsageContext > conditions , List <UsageContext > priorities ) {
385+ String leafUrl , List <UsageContext > genericContexts , List <UsageContext > priorities ) {
382386 var relatedArtifact = new RelatedArtifact ();
383387 relatedArtifact .setType (RelatedArtifact .RelatedArtifactType .DEPENDSON );
384388 relatedArtifact .setResource (leafUrl );
385389 var extensions = new ArrayList <Extension >();
386- extensions .addAll (
387- processUsageContextMapForLibrary ( conditions , TransformProperties .CRMI_INTENDED_USAGE_CONTEXT_EXT_URL ));
390+ extensions .addAll (processUsageContextMapForLibrary (
391+ genericContexts , TransformProperties .CRMI_INTENDED_USAGE_CONTEXT_EXT_URL ));
388392 extensions .addAll (
389393 processUsageContextMapForLibrary (priorities , TransformProperties .CRMI_INTENDED_USAGE_CONTEXT_EXT_URL ));
390394 relatedArtifact .setExtension (extensions );
0 commit comments