Interacting with the PH Core IG in an agile fashion - UP-Manila-SILab/ph-core GitHub Wiki
Developers can leverage the dev
and current
settings within the Sushi and IG Publisher toolchain to streamline interactions with the ph-core
IG, especially when developing dependent IGs like NHDR and Immunisation, and when performing refactoring for redundancy removal. This article will provide an instructive guide on how to utilize these powerful features for agile inter-project development.
ph-core
IG using dev
and current
settings
Interacting with The Sushi and IG Publisher toolchain offers flexible dependency resolution, allowing developers to reference both locally built IGs and those hosted on build.fhir.org
. This capability significantly accelerates development workflows for interrelated IGs.
dev
and current
Understanding The fshschool.org
documentation (specifically, https://fshschool.org/docs/sushi/configuration/#dependencies) details the dev
and current
special version identifiers. Here's a breakdown of their practical applications:
current
mode: This mode allows you to depend on the latest successful build of an IG onbuild.fhir.org
. This is ideal for agile development where you want to build your IG against the most up-to-date, albeit potentially temporary, version of a dependency.dev
mode: This mode enables you to depend on a locally built version of an IG. This is particularly powerful for refactoring and making consistent changes across multiple IGs, as it allows you to test your changes against a dependency that is also under active local development.
Practical Applications
current
mode)
1. Building Multiple IGs in Agile Fashion Against Temporary Builds (This scenario is common when IGs like NHDR and Immunisation rely on ph-core
. Instead of waiting for a formal release of ph-core
, you can develop against its current
build on build.fhir.org
.
How to implement current
mode:
-
Ensure
ph-core
is building onbuild.fhir.org
: For this to work, theph-core
IG must be configured to build and publish itscurrent
version tobuild.fhir.org
. -
Configure your dependent IG's
sushi-config.yaml
: In thesushi-config.yaml
file of your dependent IG (e.g., NHDR or Immunisation), you'll specify theph-core
dependency with thecurrent
version identifier.# sushi-config.yaml for NHDR or Immunisation IG id: your.ig.id name: YourIG status: active dependencies: example.fhir.ph.core: # This is the package ID of ph-core version: current # Use 'current' to depend on the latest build
-
Run Sushi and IG Publisher: When you run Sushi and the IG Publisher for your dependent IG, the toolchain will fetch the
current
build ofph-core
frombuild.fhir.org
and resolve dependencies against it.sushi . # followed by IG Publisher commands
Benefits:
- Faster Iteration: You can develop and test your IG against the most recent changes in
ph-core
without waiting for formal releases. - Early Issue Detection: Identify compatibility issues with
ph-core
earlier in the development cycle.
dev
mode)
2. Refactoring Multiple IGs in Agile Fashion Against Local Builds (This mode is invaluable for scenarios like removing duplication between NHDR and ph-core
, where you need to make coordinated changes across both IGs. It allows you to move elements between the IGs and immediately test the impact.
How to implement dev
mode:
-
Clone both IGs locally: Ensure you have local copies of both the
ph-core
IG and the dependent IG (e.g., NHDR) on your development machine. -
Build
ph-core
locally: First, navigate to your localph-core
directory and build it using Sushi. This will generate a local package that your dependent IG can reference.cd /path/to/your/local/ph-core-ig sushi .
-
Configure your dependent IG's
sushi-config.yaml
: In thesushi-config.yaml
of your dependent IG, you'll specify theph-core
dependency with thedev
version identifier.# sushi-config.yaml for NHDR IG id: your.ig.id name: YourIG status: active dependencies: example.fhir.ph.core: # This is the package ID of ph-core version: dev # Use 'dev' to depend on your local build
-
Run Sushi and IG Publisher for the dependent IG: Now, when you run Sushi and the IG Publisher for your dependent IG, it will look for and utilize your locally built
ph-core
package.cd /path/to/your/local/nhdr-ig sushi . # followed by IG Publisher commands
-
Iterative Refactoring: You can now make changes in
ph-core
(e.g., moving an element) and immediately update NHDR to reflect those changes. After each change, rebuildph-core
locally (sushi
inph-core
directory) and then rebuild NHDR (sushi
in NHDR directory) to test the impact.
Benefits:
- Seamless Refactoring: Perform complex refactoring operations across multiple IGs with immediate feedback.
- Eliminate Duplication: Efficiently identify and remove redundant elements by moving them to the appropriate core IG.
- Consistent Changes: Ensure changes are applied consistently across all dependent IGs.
Conclusion
The dev
and current
settings within the Sushi and IG Publisher toolchain provide developers with powerful mechanisms for agile inter-project development. By embracing these features, IG teams can significantly accelerate their work, improve consistency, and streamline the refactoring process, ultimately leading to higher quality and more maintainable FHIR Implementation Guides. While these are technical vehicles, open communication and collaboration between IG teams remain crucial to fully leverage the benefits of faster progress.