From c3bf7ba3eded5445fc29a893293ea467d3663207 Mon Sep 17 00:00:00 2001 From: Grzegorz Godlewski Date: Fri, 16 Feb 2024 14:32:24 +0100 Subject: [PATCH] Fix list indents --- src/odt/StateMachine.ts | 16 +++++++ src/odt/postprocess/addIndentsAndBullets.ts | 2 +- test/odt_md/example-document.md | 10 ++-- test/odt_md/list-indent.md | 50 ++++++++++---------- test/odt_md/list-test.md | 52 ++++++++++----------- test/odt_md/project-overview.md | 6 +-- 6 files changed, 76 insertions(+), 60 deletions(-) diff --git a/src/odt/StateMachine.ts b/src/odt/StateMachine.ts index 4b2fa165..069e283d 100644 --- a/src/odt/StateMachine.ts +++ b/src/odt/StateMachine.ts @@ -153,6 +153,22 @@ export class StateMachine { this.storeListNo(listStyleName, payload.number); } } +/* List indents should be determined from marginLefts, which are different per doc. Damnit !!! + if (tag === 'P') { + if (this.currentLevel?.tag === 'LI') { + // payload.listLevel = this.currentLevel.payload.listLevel; + const listStyleName = (payload.listStyle?.name || this.getParentListStyleName()) + '_' + payload.listLevel; + payload.listLevel = inchesToSpaces(payload.style?.paragraphProperties?.marginLeft) / 2; + + if (payload.listLevel !== this.currentLevel.payload.listLevel) { + console.log('EEEEEEEEEEEEEEE', payload.listLevel, this.currentLevel.payload.listLevel, payload.style?.paragraphProperties?.marginLeft); + } + payload.number = payload.number || this.fetchListNo(listStyleName); + payload.number++; + this.storeListNo(listStyleName, payload.number); + } + } +*/ // PRE-PUSH-PRE-TREEPUSH diff --git a/src/odt/postprocess/addIndentsAndBullets.ts b/src/odt/postprocess/addIndentsAndBullets.ts index ec375163..5cb7ed1c 100644 --- a/src/odt/postprocess/addIndentsAndBullets.ts +++ b/src/odt/postprocess/addIndentsAndBullets.ts @@ -41,7 +41,7 @@ export function addIndentsAndBullets(markdownChunks: MarkdownChunks) { mode: 'md', isTag: false, text: prevEmptyLine === 1 ? firstStr : otherStr, - comment: 'Indent or bullet' + comment: 'Indent or bullet, level: ' + level }); prevEmptyLine = 0; position2++; diff --git a/test/odt_md/example-document.md b/test/odt_md/example-document.md index af55a3ef..b78c3b43 100644 --- a/test/odt_md/example-document.md +++ b/test/odt_md/example-document.md @@ -166,12 +166,12 @@ This is after the horizontal line. * Bullet 1 * Bullet 2 - * SubBullet 1 - * SubBullet 2 + * SubBullet 1 + * SubBullet 2 * Bullet 3 - 1. SubNumeric 1 - 2. SubNumeric 2 - 3. SubNumeric 3 + 1. SubNumeric 1 + 2. SubNumeric 2 + 3. SubNumeric 3 1. Alpha 1 2. Alpha 2 3. Alpha 3 diff --git a/test/odt_md/list-indent.md b/test/odt_md/list-indent.md index 47918351..0c029d57 100644 --- a/test/odt_md/list-indent.md +++ b/test/odt_md/list-indent.md @@ -5,38 +5,38 @@ 3. When adding action items to panels, the [Representative Event panel action](#tyjcwt) is usually added to the panel first. Fill out all of the necessary fields according to the information acquired in the Health Surveillance matrix, and click Submit to save the panel action to the panel. - 1. Action Name: Required field. The Action Name is usually the name of a test/procedure that is the component/action of the panel. The name will be displayed listings and dialogues throughout the system. - 2. Lead Time: The Lead Time translates to the number of days prior to the Trigger Date the panel action becomes visible and is created within the system. This defines how many days before the Trigger Date that the panel/orders will populate on the Due List. Keep Lead Times consistent when setting multiple action items in a panel; otherwise, each component of the panel will have different Due Dates if there are different Lead Times on each. Emails can be configured to send email notifications, as needed, with a list of associated charts/employees that will be due. The recipient has the time between receiving the email and the panel action Trigger Date to notify Health Services of any issues or mistakes with the list. Emails to the member/chart will not be sent until the actual Trigger Date. (Email reminders are separately configured on a per client basis. Email notification may not apply to all clients). + 1. Action Name: Required field. The Action Name is usually the name of a test/procedure that is the component/action of the panel. The name will be displayed listings and dialogues throughout the system. + 2. Lead Time: The Lead Time translates to the number of days prior to the Trigger Date the panel action becomes visible and is created within the system. This defines how many days before the Trigger Date that the panel/orders will populate on the Due List. Keep Lead Times consistent when setting multiple action items in a panel; otherwise, each component of the panel will have different Due Dates if there are different Lead Times on each. Emails can be configured to send email notifications, as needed, with a list of associated charts/employees that will be due. The recipient has the time between receiving the email and the panel action Trigger Date to notify Health Services of any issues or mistakes with the list. Emails to the member/chart will not be sent until the actual Trigger Date. (Email reminders are separately configured on a per client basis. Email notification may not apply to all clients). {{% tip %}} - If the panel action is for a type of exposure, users will not want to set any Lead Time days. Lead Time is not needed for an exposure type panel action. - ![](1000020100000311000001824A182983854F26CB.png) + If the panel action is for a type of exposure, users will not want to set any Lead Time days. Lead Time is not needed for an exposure type panel action. + ![](1000020100000311000001824A182983854F26CB.png) {{% /tip %}} - 3. Required for Certification: Select this to indicate the panel action is required for members of the panel. Leave unchecked if the panel action is voluntary. If checked, a panel member failing or becoming overdue for the action will become de-certified from the panel. - 4. Indication Rule: Users can select any action rule found in the Action Rules editor, using the drop-down. For more information on the Action Rules, see the [Health Surveillance Action Rules](gdoc:10wTqIF8gtUDBbJmbk_LjlUeNmtU_vvbVFoVWTZnuMqc) documentation. The action rule must evaluate to True in order for this panel action to trigger for a panel member. [Action Rules](#1fob9te) are usually configured by an MIE Developer after an MIE Implementer has collected all of the necessary details for the configuration. - 1. Indication Rules can be used to only trigger the panel action for a member of the panel, if they are part of a specific department, for example. Or another more complex example would be a panel action configured to trigger a Hep3rd injection, only if the member of the panel had the second Hepatitis injection given within the last 8 weeks. - 5. Contraindication Rule: Users can select any action rule found in the Action Rules editor, using the drop-down. The action rule must evaluate to False in order for this panel action to trigger for a panel member. For more information on the Action Rules, see the [Health Surveillance Action Rules](gdoc:10wTqIF8gtUDBbJmbk_LjlUeNmtU_vvbVFoVWTZnuMqc) documentation. - 6. Trigger Type: Entry, Routine, Exit. Select the type of trigger, to define at what point in the panel member's current role/job status, the regulating agency or company requires the panel action to be completed. Entry will trigger when a panel member is first put in the panel. The Panel Evaluator scheduled job will run every day, triggering panels as appropriate, based on the the configured panel actions and the trigger type selected. - 7. Trigger Date: On what date should the panel action trigger? Use the drop-down to select one of the following Trigger Dates: - 1. Date of Birth: Triggers the panel action on the panel member's date of birth, on a schedule determined by the starting age and frequency. Assumes the panel member's DOB has been captured in the chart demographics. - 2. Other Action (Triggered): The Other Action (Triggered) trigger date allows users to trigger a panel action at the same time as another action item, indicated in this panel action. For example, an action to trigger an Audiogram may be for Entry, Routine, or Exit actions; if checked, other actions may use this panel action as a trigger. This option must be selected for the action to display in the Related Action list. The Related Action list displays when then Trigger Date is set to Other Action (Triggered) or Prior Action (Completed). Additionally, action items can be configured to trigger with the Representative Events, as needed, if that programming is utilized. This allows all action items to trigger together for a panel. Triggers with all the same date are usually tied to representative event. - - ![](100002010000033B00000036339CF669B6C2B512.png) - - 3. Point in Time: The Point in Time trigger date allows users to trigger an action item on the same day and month, each year (must be MM/DD format). - 4. Panel Expiration: Triggers on the expiration date specified in the panel status. Most panels will be configured with a representative event as the - 9. Trigger Others: If checked, other panel actions may use this action item as a trigger. This must be set for the action to display in the Related Action list. - 1. Auto-Waive (this action item) if none (no other actions) Triggered: In instances where a Representative Event may be added after the completion of all other panel actions - 10. Frequency: Day, Weeks, Months, Years. Use the drop-down to define the time period of how often the panel action should be triggered. Actions with zero (0) frequency values will trigger whenever the parent action is set to trigger. - 11. Valid For: Day, Weeks, Months, Years. Use the drop-down to define the acceptable time period for which the panel action may be performed, prior to the action Due Date, and still count as acceptable by the regulating body or company. - 1. Current Panel Only: This is a checkbox that is associated with the Valid For field. If checked, this panel action will be triggered, regardless of whether the same encounter or procedure was completed for a different panel. For example, if a panel member is included in both the Asbestos panel and Benzene panel, and both require a Chest Xray, then {{% system-name %}} would (by default) only populate Chest Xray once on the Due List. With the Current Panel Only option selected, in this example, the Chest Xray will display twice, once for each panel. - 12. Grace Period: Day, Weeks, Months, Years. Use the drop-down to define how much time the panel member is allotted to complete the panel action, from the time it is visible till the time it is considered overdue. Periodic email notifications can be set up with scheduled jobs, if preferred. The Grace Period is before the Due Date, meaning the Grace Period is the amount of time before the Due Date that the invitations, emails, and questionnaire become available. The panel member gets notified at the point of the Grace Period plus Lead Time. + 3. Required for Certification: Select this to indicate the panel action is required for members of the panel. Leave unchecked if the panel action is voluntary. If checked, a panel member failing or becoming overdue for the action will become de-certified from the panel. + 4. Indication Rule: Users can select any action rule found in the Action Rules editor, using the drop-down. For more information on the Action Rules, see the [Health Surveillance Action Rules](gdoc:10wTqIF8gtUDBbJmbk_LjlUeNmtU_vvbVFoVWTZnuMqc) documentation. The action rule must evaluate to True in order for this panel action to trigger for a panel member. [Action Rules](#1fob9te) are usually configured by an MIE Developer after an MIE Implementer has collected all of the necessary details for the configuration. + 1. Indication Rules can be used to only trigger the panel action for a member of the panel, if they are part of a specific department, for example. Or another more complex example would be a panel action configured to trigger a Hep3rd injection, only if the member of the panel had the second Hepatitis injection given within the last 8 weeks. + 5. Contraindication Rule: Users can select any action rule found in the Action Rules editor, using the drop-down. The action rule must evaluate to False in order for this panel action to trigger for a panel member. For more information on the Action Rules, see the [Health Surveillance Action Rules](gdoc:10wTqIF8gtUDBbJmbk_LjlUeNmtU_vvbVFoVWTZnuMqc) documentation. + 6. Trigger Type: Entry, Routine, Exit. Select the type of trigger, to define at what point in the panel member's current role/job status, the regulating agency or company requires the panel action to be completed. Entry will trigger when a panel member is first put in the panel. The Panel Evaluator scheduled job will run every day, triggering panels as appropriate, based on the the configured panel actions and the trigger type selected. + 7. Trigger Date: On what date should the panel action trigger? Use the drop-down to select one of the following Trigger Dates: + 1. Date of Birth: Triggers the panel action on the panel member's date of birth, on a schedule determined by the starting age and frequency. Assumes the panel member's DOB has been captured in the chart demographics. + 2. Other Action (Triggered): The Other Action (Triggered) trigger date allows users to trigger a panel action at the same time as another action item, indicated in this panel action. For example, an action to trigger an Audiogram may be for Entry, Routine, or Exit actions; if checked, other actions may use this panel action as a trigger. This option must be selected for the action to display in the Related Action list. The Related Action list displays when then Trigger Date is set to Other Action (Triggered) or Prior Action (Completed). Additionally, action items can be configured to trigger with the Representative Events, as needed, if that programming is utilized. This allows all action items to trigger together for a panel. Triggers with all the same date are usually tied to representative event. + + ![](100002010000033B00000036339CF669B6C2B512.png) + + 3. Point in Time: The Point in Time trigger date allows users to trigger an action item on the same day and month, each year (must be MM/DD format). + 4. Panel Expiration: Triggers on the expiration date specified in the panel status. Most panels will be configured with a representative event as the + 9. Trigger Others: If checked, other panel actions may use this action item as a trigger. This must be set for the action to display in the Related Action list. + 1. Auto-Waive (this action item) if none (no other actions) Triggered: In instances where a Representative Event may be added after the completion of all other panel actions + 10. Frequency: Day, Weeks, Months, Years. Use the drop-down to define the time period of how often the panel action should be triggered. Actions with zero (0) frequency values will trigger whenever the parent action is set to trigger. + 11. Valid For: Day, Weeks, Months, Years. Use the drop-down to define the acceptable time period for which the panel action may be performed, prior to the action Due Date, and still count as acceptable by the regulating body or company. + 1. Current Panel Only: This is a checkbox that is associated with the Valid For field. If checked, this panel action will be triggered, regardless of whether the same encounter or procedure was completed for a different panel. For example, if a panel member is included in both the Asbestos panel and Benzene panel, and both require a Chest Xray, then {{% system-name %}} would (by default) only populate Chest Xray once on the Due List. With the Current Panel Only option selected, in this example, the Chest Xray will display twice, once for each panel. + 12. Grace Period: Day, Weeks, Months, Years. Use the drop-down to define how much time the panel member is allotted to complete the panel action, from the time it is visible till the time it is considered overdue. Periodic email notifications can be set up with scheduled jobs, if preferred. The Grace Period is before the Due Date, meaning the Grace Period is the amount of time before the Due Date that the invitations, emails, and questionnaire become available. The panel member gets notified at the point of the Grace Period plus Lead Time. {{% note %}} - Health Questionnaires (if being done electronically and via portal) would be an Encounter event type and the specific electronic encounter order item would need selected (the order item that points to the electronic health questionnaire layout). For every questionnaire that users want documented electronically, via an encounter, two (2) order items and panel actions are needed; that's one (1) for the Health Questionnaire electronic encounter and the other (1) for the Due List item, in order to mark Complete. + Health Questionnaires (if being done electronically and via portal) would be an Encounter event type and the specific electronic encounter order item would need selected (the order item that points to the electronic health questionnaire layout). For every questionnaire that users want documented electronically, via an encounter, two (2) order items and panel actions are needed; that's one (1) for the Health Questionnaire electronic encounter and the other (1) for the Due List item, in order to mark Complete. {{% /note %}} - 13. Instructions: Free text instructions for a provider to perform this action item, if necessary. Could be instructions or pass/fail criteria, etc. + 13. Instructions: Free text instructions for a provider to perform this action item, if necessary. Could be instructions or pass/fail criteria, etc. diff --git a/test/odt_md/list-test.md b/test/odt_md/list-test.md index 1f89e138..b8636295 100644 --- a/test/odt_md/list-test.md +++ b/test/odt_md/list-test.md @@ -8,37 +8,37 @@ Action items that are configured with a Trigger Date of **Prior Action (Complet 3. level1_3 4. level1_4 - 1. level2_1 - 2. level2_2 - 3. level2_3 - 4. level2_4 + 1. level2_1 + 2. level2_2 + 3. level2_3 + 4. level2_4 {{% tip %}} - If the panel action is for a type of exposure, users will not want to set any Lead Time days. Lead Time is not needed for an exposure type panel action. + If the panel action is for a type of exposure, users will not want to set any Lead Time days. Lead Time is not needed for an exposure type panel action. {{% /tip %}} - 5. level2_5 - 6. level2_6 - 1. level3_1 - 7. level2_7 - 8. level2_8 - 9. level2_9 - 1. llevel3_1 - 2. llevel3_2 - 3. llevel3_3 - 4. llevel3_4 - 10. level2_10 - 1. lllevel3_1 - 11. level2_11 - 12. level2_12 - 1. llllevel3_1 - 13. level2_13 - 14. level2_14 + 5. level2_5 + 6. level2_6 + 1. level3_1 + 7. level2_7 + 8. level2_8 + 9. level2_9 + 1. llevel3_1 + 2. llevel3_2 + 3. llevel3_3 + 4. llevel3_4 + 10. level2_10 + 1. lllevel3_1 + 11. level2_11 + 12. level2_12 + 1. llllevel3_1 + 13. level2_13 + 14. level2_14 {{% note %}} - Health Questionnaires (if being done electronically and via portal) would be an Encounter event type and the specific electronic encounter order item would need selected (the order item that points to the electronic health questionnaire layout). For every questionnaire that users want documented electronically, via an encounter, two (2) order items and panel actions are needed; that's one (1) for the Health Questionnaire electronic encounter and the other (1) for the Due List item, in order to mark Complete. + Health Questionnaires (if being done electronically and via portal) would be an Encounter event type and the specific electronic encounter order item would need selected (the order item that points to the electronic health questionnaire layout). For every questionnaire that users want documented electronically, via an encounter, two (2) order items and panel actions are needed; that's one (1) for the Health Questionnaire electronic encounter and the other (1) for the Due List item, in order to mark Complete. {{% /note %}} - 15. level2_15 - 16. level2_16 - 17. level2_17 + 15. level2_15 + 16. level2_16 + 17. level2_17 diff --git a/test/odt_md/project-overview.md b/test/odt_md/project-overview.md index c39219d5..9895be89 100644 --- a/test/odt_md/project-overview.md +++ b/test/odt_md/project-overview.md @@ -243,11 +243,11 @@ The index is a listing of all of the defined terms and their references in the d ## Markdown Cleanup * Bold headings: ([issue](https://github.com/mieweb/wikiGDrive/issues/17)) Remove the ** bold markdown from all headings. - +![](10000201000001A5000000492C856905A808045C.png) * End of line bold text: ([issue](https://github.com/mieweb/wikiGDrive/issues/15)) The closing ** for bold text at the end of a line is being placed on a newline and not being parsed. - +![](10000201000005480000004BB83F3F8B5F0C77BD.png) * Italics/bold in an unordered list: ([issue](https://github.com/mieweb/wikiGDrive/issues/16)) Italics are not being rendered if in a list item. We may need to find these and replace the */** with em/strong tags. Example is rendered in browser next to [Google Doc](gdoc:108WScoxxGKKKOsGWF7UNZ4rLRanGXu6BPdJ-axjVn5s). - +![](1000020100000243000000F28AB7617254FDBB3A.png) ## Images