@imranq2/fhirpatientsummary 1.0.11 → 1.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +572 -632
- package/dist/index.d.cts +17 -39
- package/dist/index.d.ts +17 -39
- package/dist/index.js +572 -632
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -548,22 +548,20 @@ type TDomainResource = {
|
|
|
548
548
|
|
|
549
549
|
declare enum IPSSections {
|
|
550
550
|
PATIENT = "Patient",
|
|
551
|
-
ALLERGIES = "AllergyIntoleranceSection",
|
|
552
|
-
MEDICATIONS = "MedicationSection",
|
|
553
551
|
PROBLEMS = "ProblemSection",
|
|
552
|
+
ALLERGIES = "AllergyIntoleranceSection",
|
|
553
|
+
MEDICATIONS = "MedicationSummarySection",
|
|
554
554
|
IMMUNIZATIONS = "ImmunizationSection",
|
|
555
|
-
|
|
555
|
+
DIAGNOSTIC_REPORTS = "ResultsSection",
|
|
556
|
+
PROCEDURES = "HistoryOfProceduresSection",
|
|
556
557
|
MEDICAL_DEVICES = "MedicalDeviceSection",
|
|
557
|
-
|
|
558
|
-
PROCEDURES = "ProcedureSection",
|
|
559
|
-
FAMILY_HISTORY = "FamilyHistorySection",
|
|
560
|
-
SOCIAL_HISTORY = "SocialHistorySection",
|
|
561
|
-
PREGNANCY_HISTORY = "PregnancyHistorySection",
|
|
558
|
+
ADVANCE_DIRECTIVES = "AdvanceDirectivesSection",
|
|
562
559
|
FUNCTIONAL_STATUS = "FunctionalStatusSection",
|
|
563
|
-
|
|
564
|
-
CARE_PLAN = "
|
|
565
|
-
|
|
566
|
-
|
|
560
|
+
PREGNANCY_HISTORY = "HistoryOfPregnancySection",
|
|
561
|
+
CARE_PLAN = "PlanOfCareSection",
|
|
562
|
+
MEDICAL_HISTORY = "HistoryOfPastIllnessSection",
|
|
563
|
+
SOCIAL_HISTORY = "SocialHistorySection",
|
|
564
|
+
VITAL_SIGNS = "VitalSignsSection"
|
|
567
565
|
}
|
|
568
566
|
|
|
569
567
|
type TBundleLink = {
|
|
@@ -635,7 +633,6 @@ type TBundle = {
|
|
|
635
633
|
declare class ComprehensiveIPSCompositionBuilder {
|
|
636
634
|
private patient;
|
|
637
635
|
private sections;
|
|
638
|
-
private mandatorySectionsAdded;
|
|
639
636
|
private resources;
|
|
640
637
|
/**
|
|
641
638
|
* sets the patient resource for the IPS Composition.
|
|
@@ -646,25 +643,16 @@ declare class ComprehensiveIPSCompositionBuilder {
|
|
|
646
643
|
/**
|
|
647
644
|
* Adds a section to the composition with async HTML minification
|
|
648
645
|
* @param sectionType - IPS section type
|
|
649
|
-
* @param
|
|
646
|
+
* @param validResources - Array of domain resources
|
|
650
647
|
* @param timezone - Optional timezone to use for date formatting
|
|
651
|
-
* @param options - Optional configuration options
|
|
652
648
|
*/
|
|
653
|
-
addSectionAsync<T extends TDomainResource>(sectionType: IPSSections,
|
|
654
|
-
isOptional?: boolean;
|
|
655
|
-
customLoincCode?: string;
|
|
656
|
-
}): Promise<this>;
|
|
649
|
+
addSectionAsync<T extends TDomainResource>(sectionType: IPSSections, validResources: T[], timezone: string | undefined): Promise<this>;
|
|
657
650
|
/**
|
|
658
651
|
* Reads a FHIR Bundle and extracts resources for each section defined in IPSSections.
|
|
659
652
|
* @param bundle - FHIR Bundle containing resources
|
|
660
653
|
* @param timezone - Optional timezone to use for date formatting
|
|
661
654
|
*/
|
|
662
655
|
readBundleAsync(bundle: TBundle, timezone: string | undefined): Promise<this>;
|
|
663
|
-
/**
|
|
664
|
-
* Builds the final Composition sections, ensuring all mandatory sections are present.
|
|
665
|
-
* @param timezone - Optional timezone to use for date formatting (e.g., 'America/New_York', 'Europe/London')
|
|
666
|
-
*/
|
|
667
|
-
build(timezone: string | undefined): TCompositionSection[];
|
|
668
656
|
/**
|
|
669
657
|
* Builds a complete FHIR Bundle containing the Composition and all resources.
|
|
670
658
|
* @param authorOrganizationId - ID of the authoring organization (e.g., hospital or clinic)
|
|
@@ -674,11 +662,10 @@ declare class ComprehensiveIPSCompositionBuilder {
|
|
|
674
662
|
*/
|
|
675
663
|
buildBundleAsync(authorOrganizationId: string, authorOrganizationName: string, baseUrl: string, timezone: string | undefined): Promise<TBundle>;
|
|
676
664
|
/**
|
|
677
|
-
*
|
|
678
|
-
* @
|
|
679
|
-
* @private
|
|
665
|
+
* Returns the Composition sections without creating a full bundle.
|
|
666
|
+
* @returns Array of TCompositionSection
|
|
680
667
|
*/
|
|
681
|
-
|
|
668
|
+
getSections(): TCompositionSection[];
|
|
682
669
|
}
|
|
683
670
|
|
|
684
671
|
interface Narrative {
|
|
@@ -695,10 +682,9 @@ declare class NarrativeGenerator {
|
|
|
695
682
|
* @param section - IPS section type
|
|
696
683
|
* @param resources - Array of domain resources
|
|
697
684
|
* @param timezone - Optional timezone to use for date formatting (e.g., 'America/New_York', 'Europe/London')
|
|
698
|
-
* @param wrapInXhtml - Whether to wrap the content in XHTML div
|
|
699
685
|
* @returns Generated HTML content or undefined if no resources
|
|
700
686
|
*/
|
|
701
|
-
static generateNarrativeContentAsync<T extends TDomainResource>(section: IPSSections, resources: T[], timezone: string | undefined
|
|
687
|
+
static generateNarrativeContentAsync<T extends TDomainResource>(section: IPSSections, resources: T[], timezone: string | undefined): Promise<string | undefined>;
|
|
702
688
|
/**
|
|
703
689
|
* Minifies HTML content asynchronously using html-minifier-terser
|
|
704
690
|
* @param html - HTML content to minify
|
|
@@ -719,17 +705,9 @@ declare class NarrativeGenerator {
|
|
|
719
705
|
* @param resources - Array of domain resources
|
|
720
706
|
* @param timezone - Optional timezone to use for date formatting
|
|
721
707
|
* @param minify - Whether to minify the HTML content (default: true)
|
|
722
|
-
* @param wrapInXhtml - Whether to wrap the content in XHTML div
|
|
723
708
|
* @returns Promise that resolves to a FHIR Narrative object or undefined if no resources
|
|
724
709
|
*/
|
|
725
|
-
static generateNarrativeAsync<T extends TDomainResource>(section: IPSSections, resources: T[], timezone: string | undefined, minify
|
|
726
|
-
/**
|
|
727
|
-
* Wrap content in XHTML div with FHIR namespace asynchronously
|
|
728
|
-
* @param content - HTML content to wrap
|
|
729
|
-
* @param minify - Whether to minify the HTML content before wrapping (default: false)
|
|
730
|
-
* @returns Promise that resolves to XHTML div string
|
|
731
|
-
*/
|
|
732
|
-
static wrapInXhtmlAsync(content: string, minify?: boolean): Promise<string>;
|
|
710
|
+
static generateNarrativeAsync<T extends TDomainResource>(section: IPSSections, resources: T[], timezone: string | undefined, minify?: boolean): Promise<Narrative | undefined>;
|
|
733
711
|
}
|
|
734
712
|
|
|
735
713
|
declare const myPackage: (taco?: string) => string;
|
package/dist/index.d.ts
CHANGED
|
@@ -548,22 +548,20 @@ type TDomainResource = {
|
|
|
548
548
|
|
|
549
549
|
declare enum IPSSections {
|
|
550
550
|
PATIENT = "Patient",
|
|
551
|
-
ALLERGIES = "AllergyIntoleranceSection",
|
|
552
|
-
MEDICATIONS = "MedicationSection",
|
|
553
551
|
PROBLEMS = "ProblemSection",
|
|
552
|
+
ALLERGIES = "AllergyIntoleranceSection",
|
|
553
|
+
MEDICATIONS = "MedicationSummarySection",
|
|
554
554
|
IMMUNIZATIONS = "ImmunizationSection",
|
|
555
|
-
|
|
555
|
+
DIAGNOSTIC_REPORTS = "ResultsSection",
|
|
556
|
+
PROCEDURES = "HistoryOfProceduresSection",
|
|
556
557
|
MEDICAL_DEVICES = "MedicalDeviceSection",
|
|
557
|
-
|
|
558
|
-
PROCEDURES = "ProcedureSection",
|
|
559
|
-
FAMILY_HISTORY = "FamilyHistorySection",
|
|
560
|
-
SOCIAL_HISTORY = "SocialHistorySection",
|
|
561
|
-
PREGNANCY_HISTORY = "PregnancyHistorySection",
|
|
558
|
+
ADVANCE_DIRECTIVES = "AdvanceDirectivesSection",
|
|
562
559
|
FUNCTIONAL_STATUS = "FunctionalStatusSection",
|
|
563
|
-
|
|
564
|
-
CARE_PLAN = "
|
|
565
|
-
|
|
566
|
-
|
|
560
|
+
PREGNANCY_HISTORY = "HistoryOfPregnancySection",
|
|
561
|
+
CARE_PLAN = "PlanOfCareSection",
|
|
562
|
+
MEDICAL_HISTORY = "HistoryOfPastIllnessSection",
|
|
563
|
+
SOCIAL_HISTORY = "SocialHistorySection",
|
|
564
|
+
VITAL_SIGNS = "VitalSignsSection"
|
|
567
565
|
}
|
|
568
566
|
|
|
569
567
|
type TBundleLink = {
|
|
@@ -635,7 +633,6 @@ type TBundle = {
|
|
|
635
633
|
declare class ComprehensiveIPSCompositionBuilder {
|
|
636
634
|
private patient;
|
|
637
635
|
private sections;
|
|
638
|
-
private mandatorySectionsAdded;
|
|
639
636
|
private resources;
|
|
640
637
|
/**
|
|
641
638
|
* sets the patient resource for the IPS Composition.
|
|
@@ -646,25 +643,16 @@ declare class ComprehensiveIPSCompositionBuilder {
|
|
|
646
643
|
/**
|
|
647
644
|
* Adds a section to the composition with async HTML minification
|
|
648
645
|
* @param sectionType - IPS section type
|
|
649
|
-
* @param
|
|
646
|
+
* @param validResources - Array of domain resources
|
|
650
647
|
* @param timezone - Optional timezone to use for date formatting
|
|
651
|
-
* @param options - Optional configuration options
|
|
652
648
|
*/
|
|
653
|
-
addSectionAsync<T extends TDomainResource>(sectionType: IPSSections,
|
|
654
|
-
isOptional?: boolean;
|
|
655
|
-
customLoincCode?: string;
|
|
656
|
-
}): Promise<this>;
|
|
649
|
+
addSectionAsync<T extends TDomainResource>(sectionType: IPSSections, validResources: T[], timezone: string | undefined): Promise<this>;
|
|
657
650
|
/**
|
|
658
651
|
* Reads a FHIR Bundle and extracts resources for each section defined in IPSSections.
|
|
659
652
|
* @param bundle - FHIR Bundle containing resources
|
|
660
653
|
* @param timezone - Optional timezone to use for date formatting
|
|
661
654
|
*/
|
|
662
655
|
readBundleAsync(bundle: TBundle, timezone: string | undefined): Promise<this>;
|
|
663
|
-
/**
|
|
664
|
-
* Builds the final Composition sections, ensuring all mandatory sections are present.
|
|
665
|
-
* @param timezone - Optional timezone to use for date formatting (e.g., 'America/New_York', 'Europe/London')
|
|
666
|
-
*/
|
|
667
|
-
build(timezone: string | undefined): TCompositionSection[];
|
|
668
656
|
/**
|
|
669
657
|
* Builds a complete FHIR Bundle containing the Composition and all resources.
|
|
670
658
|
* @param authorOrganizationId - ID of the authoring organization (e.g., hospital or clinic)
|
|
@@ -674,11 +662,10 @@ declare class ComprehensiveIPSCompositionBuilder {
|
|
|
674
662
|
*/
|
|
675
663
|
buildBundleAsync(authorOrganizationId: string, authorOrganizationName: string, baseUrl: string, timezone: string | undefined): Promise<TBundle>;
|
|
676
664
|
/**
|
|
677
|
-
*
|
|
678
|
-
* @
|
|
679
|
-
* @private
|
|
665
|
+
* Returns the Composition sections without creating a full bundle.
|
|
666
|
+
* @returns Array of TCompositionSection
|
|
680
667
|
*/
|
|
681
|
-
|
|
668
|
+
getSections(): TCompositionSection[];
|
|
682
669
|
}
|
|
683
670
|
|
|
684
671
|
interface Narrative {
|
|
@@ -695,10 +682,9 @@ declare class NarrativeGenerator {
|
|
|
695
682
|
* @param section - IPS section type
|
|
696
683
|
* @param resources - Array of domain resources
|
|
697
684
|
* @param timezone - Optional timezone to use for date formatting (e.g., 'America/New_York', 'Europe/London')
|
|
698
|
-
* @param wrapInXhtml - Whether to wrap the content in XHTML div
|
|
699
685
|
* @returns Generated HTML content or undefined if no resources
|
|
700
686
|
*/
|
|
701
|
-
static generateNarrativeContentAsync<T extends TDomainResource>(section: IPSSections, resources: T[], timezone: string | undefined
|
|
687
|
+
static generateNarrativeContentAsync<T extends TDomainResource>(section: IPSSections, resources: T[], timezone: string | undefined): Promise<string | undefined>;
|
|
702
688
|
/**
|
|
703
689
|
* Minifies HTML content asynchronously using html-minifier-terser
|
|
704
690
|
* @param html - HTML content to minify
|
|
@@ -719,17 +705,9 @@ declare class NarrativeGenerator {
|
|
|
719
705
|
* @param resources - Array of domain resources
|
|
720
706
|
* @param timezone - Optional timezone to use for date formatting
|
|
721
707
|
* @param minify - Whether to minify the HTML content (default: true)
|
|
722
|
-
* @param wrapInXhtml - Whether to wrap the content in XHTML div
|
|
723
708
|
* @returns Promise that resolves to a FHIR Narrative object or undefined if no resources
|
|
724
709
|
*/
|
|
725
|
-
static generateNarrativeAsync<T extends TDomainResource>(section: IPSSections, resources: T[], timezone: string | undefined, minify
|
|
726
|
-
/**
|
|
727
|
-
* Wrap content in XHTML div with FHIR namespace asynchronously
|
|
728
|
-
* @param content - HTML content to wrap
|
|
729
|
-
* @param minify - Whether to minify the HTML content before wrapping (default: false)
|
|
730
|
-
* @returns Promise that resolves to XHTML div string
|
|
731
|
-
*/
|
|
732
|
-
static wrapInXhtmlAsync(content: string, minify?: boolean): Promise<string>;
|
|
710
|
+
static generateNarrativeAsync<T extends TDomainResource>(section: IPSSections, resources: T[], timezone: string | undefined, minify?: boolean): Promise<Narrative | undefined>;
|
|
733
711
|
}
|
|
734
712
|
|
|
735
713
|
declare const myPackage: (taco?: string) => string;
|