heathfrankel / inferno-au-core

Use this template to start making your own Inferno Test Kit
Apache License 2.0
1 stars 1 forks source link

Document changes from US Core generator #9

Open ir4y opened 8 months ago

ir4y commented 8 months ago

We need a document that describes the differences between the US Core and Au Core structure and related changes to the generator. It will help us in the future to contribute back to US Core generator and possible use it as it is.

projkov commented 7 months ago

I analyzed changes via automatic script which gets differences via git diff. With the help of the script, I realized that 16 files had been changed.

These changes do not include:

  1. Deleted files;
  2. Renamed files;
  3. Renamed content inside of files.

The next comments will include differences with detailed descriptions.

1/16 File: generator.rb Description: Adding the MDSummaryGenerator and using it in the generator workflow. Reason: For the confluence users Detailed changes:

  1. Insert generator into the generator pipeline at the end
  2. Add a method to run MDSummaryGenerator
projkov commented 7 months ago

2/16 File: group_generator.rb

Description: Sorting of the tests. Search tests, read tests, and other tests. Reason: Search tests should come first because with these tests the test group data is first queried. Search tests use values stored in metadata. Reading tests use data from the resources that were obtained from search tests. Detailed changes:

  1. https://github.com/heathfrankel/inferno-au-core/blob/c7a2cca16d59d8bccbfdc01daef62503e202adda/lib/au_core_test_kit/generator/group_generator.rb#L124

Description: Using a helper method to generate a group description Reason: The creation of this method was justified by the need to use the same content in different documents, with different markup. Detailed changes:

  1. https://github.com/heathfrankel/inferno-au-core/blob/c7a2cca16d59d8bccbfdc01daef62503e202adda/lib/au_core_test_kit/generator/group_generator.rb#L151
projkov commented 7 months ago

3/16 File: group_metadata_extractor.rb

Description: Updated the "ALL_VERSION_CATEGORY_FIRST_PROFILES" constant Reason: The update is explained by differences from the US core list of profiles, in which the primary search must be carried out through the category. Detailed changes:

  1. https://github.com/heathfrankel/inferno-au-core/blob/c7a2cca16d59d8bccbfdc01daef62503e202adda/lib/au_core_test_kit/generator/group_metadata_extractor.rb#L98

Description: Added the "ALL_VERSION_PATIENT_FIRST_PROFILES" constant Reason: This was added because there are profile sets whose generated metadata does not contain search constants. Therefore, in this case, the search for the patient will be the primary search in their test group. Detailed changes:

  1. https://github.com/heathfrankel/inferno-au-core/blob/c7a2cca16d59d8bccbfdc01daef62503e202adda/lib/au_core_test_kit/generator/group_metadata_extractor.rb#L103
  2. https://github.com/heathfrankel/inferno-au-core/blob/c7a2cca16d59d8bccbfdc01daef62503e202adda/lib/au_core_test_kit/generator/group_metadata_extractor.rb#L135
  3. https://github.com/heathfrankel/inferno-au-core/blob/c7a2cca16d59d8bccbfdc01daef62503e202adda/lib/au_core_test_kit/generator/group_metadata_extractor.rb#L143

Description: Updated the "ALL_VERSION_ID_FIRST_PROFILES" constant Reason: Added because there are no search constants and there is no direct link to the patient. In this case, you need to search by ID. Other notes: Maybe it should work in another way: like a provenance test group. In these cases, we get data from other test groups and we don't need to get data directly in current test groups. Detailed changes:

  1. https://github.com/heathfrankel/inferno-au-core/blob/c7a2cca16d59d8bccbfdc01daef62503e202adda/lib/au_core_test_kit/generator/group_metadata_extractor.rb#L108
  2. https://github.com/heathfrankel/inferno-au-core/blob/c7a2cca16d59d8bccbfdc01daef62503e202adda/lib/au_core_test_kit/generator/group_metadata_extractor.rb#L126
  3. https://github.com/heathfrankel/inferno-au-core/blob/c7a2cca16d59d8bccbfdc01daef62503e202adda/lib/au_core_test_kit/generator/group_metadata_extractor.rb#L145

Description: Updated the "ALL_VERSION_NAME_FIRST_PROFILES" constant Reason: Added because the generated metadata lacks a search by ID, a direct link to the patient, and constants for searching by attributes. Other notes: Maybe it should be removed because profiles with this requirement do not exist in the March release (previously it was a HealthcareService) Detailed changes:

  1. https://github.com/heathfrankel/inferno-au-core/blob/c7a2cca16d59d8bccbfdc01daef62503e202adda/lib/au_core_test_kit/generator/group_metadata_extractor.rb#L113
  2. https://github.com/heathfrankel/inferno-au-core/blob/c7a2cca16d59d8bccbfdc01daef62503e202adda/lib/au_core_test_kit/generator/group_metadata_extractor.rb#L122
  3. https://github.com/heathfrankel/inferno-au-core/blob/c7a2cca16d59d8bccbfdc01daef62503e202adda/lib/au_core_test_kit/generator/group_metadata_extractor.rb#L147

Description: Updated the profile method Reason: The reason for adding this update is that there is a reference to a StructureDefinition in the profiles, which does not exist in IG. Other notes: It appears that this patch is no longer required after the March release. The March release is missing a link to a non-existent profile. Required DELETE Detailed changes:

  1. https://github.com/heathfrankel/inferno-au-core/blob/c7a2cca16d59d8bccbfdc01daef62503e202adda/lib/au_core_test_kit/generator/group_metadata_extractor.rb#L174
projkov commented 7 months ago

4/16 File: ig_loader.rb

Description: Updated the load_ig method Reason: The reason for updating this method was the lack of search parameters and StructureDefinition. Other notes: Re-checking is required, there may be some set of problems: perhaps the attachment of resources is no longer required, perhaps some of the added resources are no longer required. DOUBLE CHECKING is required. Detailed changes:

  1. https://github.com/heathfrankel/inferno-au-core/blob/c7a2cca16d59d8bccbfdc01daef62503e202adda/lib/au_core_test_kit/generator/ig_loader.rb#L53
projkov commented 7 months ago

5/16 File: ig_metadata_extractor.rb

Description: Updated the add_metadata_from_resources method Reason: The reason for updating this method was due to a problem with non-existent profiles. In addition, a compact method has been added. Other notes: It is necessary to RE-CHECK the need to use the compact method. Detailed changes:

  1. https://github.com/heathfrankel/inferno-au-core/blob/c7a2cca16d59d8bccbfdc01daef62503e202adda/lib/au_core_test_kit/generator/ig_metadata_extractor.rb#L63
projkov commented 7 months ago

6/16 File: ig_resources.rb

Description: Updated the search_param_by_resource_and_name method Reason: The reason for updating this method was the problem that some search parameters were missing or there were more than 1 of them. Other notes: Initially, the method was a fairly simple search. It now contains conditional statements and several additional methods. It seems to me that there is a method there that can simply be removed, because it is a method that calls another method. METHOD EDITING REQUIRED Detailed changes:

  1. https://github.com/heathfrankel/inferno-au-core/blob/c7a2cca16d59d8bccbfdc01daef62503e202adda/lib/au_core_test_kit/generator/ig_resources.rb#L93
projkov commented 7 months ago

7/16 File: must_support_metadata_extractor.rb

Description: Updated the handle_special_cases method by adding new remove_observation_method_attribute method Reason: In some observation profiles method attribute should not exist as MS. Detailed changes:

  1. https://github.com/heathfrankel/inferno-au-core/blob/c7a2cca16d59d8bccbfdc01daef62503e202adda/lib/au_core_test_kit/generator/must_support_metadata_extractor.rb#L335
  2. https://github.com/heathfrankel/inferno-au-core/blob/c7a2cca16d59d8bccbfdc01daef62503e202adda/lib/au_core_test_kit/generator/must_support_metadata_extractor.rb#L375

Description: Updated the handle_special_cases method by adding new remove_observation_value_attribute method Reason: In some observation profiles value attribute should not exist as MS. Detailed changes:

  1. https://github.com/heathfrankel/inferno-au-core/blob/c7a2cca16d59d8bccbfdc01daef62503e202adda/lib/au_core_test_kit/generator/must_support_metadata_extractor.rb#L336
  2. https://github.com/heathfrankel/inferno-au-core/blob/c7a2cca16d59d8bccbfdc01daef62503e202adda/lib/au_core_test_kit/generator/must_support_metadata_extractor.rb#L366
  3. https://github.com/heathfrankel/inferno-au-core/blob/c7a2cca16d59d8bccbfdc01daef62503e202adda/lib/au_core_test_kit/generator/must_support_metadata_extractor.rb#L406

Description: Updated the handle_special_cases method by adding new remove_lipid_result_attributes method Reason: For some unknown reason, in one survey profile in particular, a large number of attributes are labeled as MS, but this should not be the case. Other notes: It is required, if possible, to IDENTIFY and CORRECT the problem of the appearance of a large number of attributes marked as MS. Detailed changes:

  1. https://github.com/heathfrankel/inferno-au-core/blob/c7a2cca16d59d8bccbfdc01daef62503e202adda/lib/au_core_test_kit/generator/must_support_metadata_extractor.rb#L337
  2. https://github.com/heathfrankel/inferno-au-core/blob/c7a2cca16d59d8bccbfdc01daef62503e202adda/lib/au_core_test_kit/generator/must_support_metadata_extractor.rb#L353
projkov commented 7 months ago

8/16 File: must_support_test.rb

Description: Updated the missing_extensions method Reason: The reason for updating this method is that in the initial version, extensions were obtained only through the "extension" attribute. This update allows you to extract the extension from any part of the resource. Detailed changes:

  1. https://github.com/heathfrankel/inferno-au-core/blob/c7a2cca16d59d8bccbfdc01daef62503e202adda/lib/au_core_test_kit/must_support_test.rb#L87
projkov commented 7 months ago

9/16 File: naming.rb

Description: Updated naming constants Reason: The reason for the update is to change links to profiles. Other notes: You need to DOUBLE CHECK and find out how current the profiles and their names are. Detailed changes:

  1. https://github.com/heathfrankel/inferno-au-core/blob/c7a2cca16d59d8bccbfdc01daef62503e202adda/lib/au_core_test_kit/generator/naming.rb#L4
projkov commented 7 months ago

10/16 File: read_test_generator.rb

Description: Updated resource_collection_string method by adding all_scratch_resources for some resource types Reason: The reason for the update is the inability to obtain some resources from references. Therefore, a resource search is used across all received resources. Other notes: At a minimum, you need to DELETE HealthcareService, and at a maximum, you need to understand the relevance of this update. Detailed changes:

  1. https://github.com/heathfrankel/inferno-au-core/blob/c7a2cca16d59d8bccbfdc01daef62503e202adda/lib/au_core_test_kit/generator/read_test_generator.rb#L72
projkov commented 7 months ago

11/16 File: reference_resolution_test.rb

Description: Add a hardcoded profile with the version for the reference resolution Reason: The reason was the lack of a profile on the terminology server of the same version as that used in the AU core. Detailed changes:

  1. https://github.com/heathfrankel/inferno-au-core/blob/c7a2cca16d59d8bccbfdc01daef62503e202adda/lib/au_core_test_kit/reference_resolution_test.rb#L162
projkov commented 7 months ago

12/16 File: search_test_generator.rb

Description: Add needs_organization_id? method Reason: The reason was the need to add input values to a group of tests associated with the Organization resource. Other notes: There is a possibility that this method may be removed. DOUBLE CHECKING is required. Detailed changes:

  1. https://github.com/heathfrankel/inferno-au-core/blob/c7a2cca16d59d8bccbfdc01daef62503e202adda/lib/au_core_test_kit/generator/search_test_generator.rb#L110

Description: Add needs_practitioner_id? method Reason: The reason was the need to add input values to a group of tests associated with the Practitioner resource. Other notes: There is a possibility that this method may be removed. DOUBLE CHECKING is required. Detailed changes:

  1. https://github.com/heathfrankel/inferno-au-core/blob/c7a2cca16d59d8bccbfdc01daef62503e202adda/lib/au_core_test_kit/generator/search_test_generator.rb#L114

Description: Add needs_healthcare_service_name? method Reason: The reason was the need to add input values to a group of tests associated with the HealthcareService resource. Other notes: Should be DELETED Detailed changes:

  1. https://github.com/heathfrankel/inferno-au-core/blob/c7a2cca16d59d8bccbfdc01daef62503e202adda/lib/au_core_test_kit/generator/search_test_generator.rb#L118
projkov commented 7 months ago

13/16 File: search.rb.erb

Description: Add organization IDs to the search test template if it needs organization IDs Reason: The reason for this addition is that tests associated with the Organization resource require IDs to be entered. Other notes: There is a possibility that this code may be removed. DOUBLE CHECKING is required. Detailed changes:

  1. https://github.com/heathfrankel/inferno-au-core/blob/c7a2cca16d59d8bccbfdc01daef62503e202adda/lib/au_core_test_kit/generator/templates/search.rb.erb#L21

Description: Add practitioner IDs to the search test template if it needs practitioners IDs Reason: The reason for this addition is that tests associated with the Practitioner resource require IDs to be entered. Other notes: There is a possibility that this code may be removed. DOUBLE CHECKING is required. Detailed changes:

  1. https://github.com/heathfrankel/inferno-au-core/blob/c7a2cca16d59d8bccbfdc01daef62503e202adda/lib/au_core_test_kit/generator/templates/search.rb.erb#L26

Description: Add HealthcareService IDs to the search test template if it needs healthcare services IDs Reason: The reason for this addition is that tests associated with the HealthcareService resource require IDs to be entered. Other notes: Should be DELETED Detailed changes: https://github.com/heathfrankel/inferno-au-core/blob/c7a2cca16d59d8bccbfdc01daef62503e202adda/lib/au_core_test_kit/generator/templates/search.rb.erb#L31

projkov commented 7 months ago

14/16 File: special_cases.rb

Description: Add RelatedPerson to constant called RESOURCES_TO_EXCLUDE Reason: This constant stores a list of resources for which it is not necessary to create test groups. In this particular case, RelatedPerson is a dependency, but it is not contained in the AU Core, so tests are not created for it. Detailed changes:

  1. https://github.com/heathfrankel/inferno-au-core/blob/c7a2cca16d59d8bccbfdc01daef62503e202adda/lib/au_core_test_kit/generator/special_cases.rb#L8
projkov commented 7 months ago

15/16 File: search_definition_metadata_extractor.rb

Description: full_paths method refactoring Reason: I think now it's better to read Detailed changes:

  1. https://github.com/heathfrankel/inferno-au-core/blob/c7a2cca16d59d8bccbfdc01daef62503e202adda/lib/au_core_test_kit/generator/search_definition_metadata_extractor.rb#L44

Description: multiple_or_expectation method update Reason: It was necessary to update because there were probably some missing values in the data. Other notes: Need to REVIEW Detailed changes:

  1. https://github.com/heathfrankel/inferno-au-core/blob/c7a2cca16d59d8bccbfdc01daef62503e202adda/lib/au_core_test_kit/generator/search_definition_metadata_extractor.rb#L172

Description: values method update Reason: It was necessary to add the ability to work with patternCoding Other notes: Need to REVIEW

  1. https://github.com/heathfrankel/inferno-au-core/blob/c7a2cca16d59d8bccbfdc01daef62503e202adda/lib/au_core_test_kit/generator/search_definition_metadata_extractor.rb#L182
projkov commented 7 months ago

16/16 File: search_test.rb

Description: search_params_with_values method update for Organization values Reason: It is necessary for getting search params values for the Organization resource test group Other notes: Maybe it can be removed if we don't need to use organization ids (RESEARCH) Detailed changes:

  1. https://github.com/heathfrankel/inferno-au-core/blob/c7a2cca16d59d8bccbfdc01daef62503e202adda/lib/au_core_test_kit/search_test.rb#L473
  2. https://github.com/heathfrankel/inferno-au-core/blob/c7a2cca16d59d8bccbfdc01daef62503e202adda/lib/au_core_test_kit/search_test.rb#L506
  3. https://github.com/heathfrankel/inferno-au-core/blob/c7a2cca16d59d8bccbfdc01daef62503e202adda/lib/au_core_test_kit/search_test.rb#L521
  4. https://github.com/heathfrankel/inferno-au-core/blob/c7a2cca16d59d8bccbfdc01daef62503e202adda/lib/au_core_test_kit/search_test.rb#L547

Description: search_params_with_values method update for Practitioner values Reason: It is necessary for getting search params values for the Practitioner resource test group Other notes: Maybe it can be removed if we don't need to use practitioner ids (RESEARCH) Detailed changes:

  1. https://github.com/heathfrankel/inferno-au-core/blob/c7a2cca16d59d8bccbfdc01daef62503e202adda/lib/au_core_test_kit/search_test.rb#L476
  2. https://github.com/heathfrankel/inferno-au-core/blob/c7a2cca16d59d8bccbfdc01daef62503e202adda/lib/au_core_test_kit/search_test.rb#L509
  3. https://github.com/heathfrankel/inferno-au-core/blob/c7a2cca16d59d8bccbfdc01daef62503e202adda/lib/au_core_test_kit/search_test.rb#L527
  4. https://github.com/heathfrankel/inferno-au-core/blob/c7a2cca16d59d8bccbfdc01daef62503e202adda/lib/au_core_test_kit/search_test.rb#L551

Description: search_params_with_values method update for HealthcareService values Reason: It is necessary for getting search params values for the HealthcareService resource test group Other notes: Should be REMOVED Detailed changes:

  1. https://github.com/heathfrankel/inferno-au-core/blob/c7a2cca16d59d8bccbfdc01daef62503e202adda/lib/au_core_test_kit/search_test.rb#L479
  2. https://github.com/heathfrankel/inferno-au-core/blob/c7a2cca16d59d8bccbfdc01daef62503e202adda/lib/au_core_test_kit/search_test.rb#L512
  3. https://github.com/heathfrankel/inferno-au-core/blob/c7a2cca16d59d8bccbfdc01daef62503e202adda/lib/au_core_test_kit/search_test.rb#L533
  4. https://github.com/heathfrankel/inferno-au-core/blob/c7a2cca16d59d8bccbfdc01daef62503e202adda/lib/au_core_test_kit/search_test.rb#L555