Skip to content

Commit

Permalink
Migrate contact summary (#1688)
Browse files Browse the repository at this point in the history
* Migrate contact summary

* Update content/en/building/contact-summary/_index.md

Co-authored-by: Andra Blaj <[email protected]>

* Update content/en/building/contact-summary/contact-summary-overview.md

Co-authored-by: Andra Blaj <[email protected]>

* Update content/en/building/contact-summary/contact-summary-overview.md

Co-authored-by: Andra Blaj <[email protected]>

* Update content/en/building/contact-summary/contact-summary-templated.md

Co-authored-by: Andra Blaj <[email protected]>

---------

Co-authored-by: Andra Blaj <[email protected]>
  • Loading branch information
esthermmoturi and andrablaj authored Nov 6, 2024
1 parent ce2dd28 commit 56e552f
Show file tree
Hide file tree
Showing 13 changed files with 36 additions and 26 deletions.
2 changes: 1 addition & 1 deletion content/en/building/concepts/care-guides.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ keywords: care-guides
relatedContent: >
building/concepts/forms
building/tasks/#care-guides
building/reference/contact-page/#care-guides
building/contact-summary/contact-summary-templated/#care-guides
aliases:
- /apps/concepts/care-guides
---
Expand Down
8 changes: 4 additions & 4 deletions content/en/building/contact-management/contacts.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: >
keywords: hierarchy contacts care-guides
relatedContent: >
building/reference/forms/contact
building/reference/contact-page
building/contact-summary/contact-summary-templated
building/contact-management/moving-contacts
building/contact-management/contact-and-users-1
building/examples/contact-tracing
Expand Down Expand Up @@ -87,7 +87,7 @@ The top card on all profiles contains general information for the contact. All t
</div>
</div>

{{< see-also page="contact-page" anchor="contact-summary" title="Defining Contact Summary" >}}
{{< see-also page="contact-summary-templated" anchor="contact-summary" title="Defining Contact Summary" >}}

### Condition Cards

Expand All @@ -109,7 +109,7 @@ Configurable elements include:
</div>
</div>

{{< see-also page="contact-page" anchor="condition-cards" title="Defining Condition Cards" >}}
{{< see-also page="contact-summary-templated" anchor="condition-cards" title="Defining Condition Cards" >}}


## Care Guides
Expand All @@ -124,7 +124,7 @@ You’ll see different forms here depending on which person or place you’re vi

Health workers can use these Care Guides at any time. If the app has scheduled a care visit or follow up, it will be listed under “Tasks.”

{{< see-also page="contact-page" anchor="care-guides" title="Defining Care Guides" >}}
{{< see-also page="contact-summary-templated" anchor="care-guides" title="Defining Care Guides" >}}

<br clear="all">

Expand Down
8 changes: 8 additions & 0 deletions content/en/building/contact-summary/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: CHT Contact Summary
linkTitle: Contact Summary
identifier: Contact Summary
weight: 6
description: >
Overview and configuration of CHT Contact Summary
---
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
---
title: "Building Contact Summary"
linkTitle: Contact Summary
weight: 11
title: Building Contact Summary
linkTitle: Building
weight: 1
description: >
Building CHT application contact summary
relatedContent: >
building/contact-management#contact-summary
building/reference/contact-page#contact-summary
building/contact-summary/contact-summary-templated#contact-summary
aliases:
- /building/tutorials/contact-summary
- /apps/tutorials/contact-summary
---

Expand All @@ -22,7 +23,7 @@ You will be adding a contact summary that displays information about a person's

## Brief Overview of Key Concepts

Each *field* that can be shown on a contact’s profile is defined as an object in the *[fields array]({{< ref "building/reference/contact-page#contact-summarytemplatedjs-fields" >}})* of `contact-summary.templated.js`.
Each *field* that can be shown on a contact’s profile is defined as an object in the *[fields array]({{< ref "building/contact-summary/contact-summary-templated#contact-summarytemplatedjs-fields" >}})* of `contact-summary.templated.js`.

The *properties* for each object determine how and when the field is shown.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
---
title: "contact-summary.templated.js"
linkTitle: "contact-summary.templated.js"
weight: 5
title: contact-summary.templated.js
linkTitle: contact-summary.templated.js
weight: 2
description: >
**Contact Pages**: Customizing the fields, cards, and actions on profile pages
Customizing the fields, cards, and actions on profile pages
relatedContent: >
building/guides/forms/form-inputs
relevantLinks: >
docs/building/features/contacts
docs/building/concepts/hierarchies
keywords: hierarchy contacts care-guides
aliases:
- /building/reference/contact-page
- /apps/reference/contact-page
---

Expand Down
4 changes: 2 additions & 2 deletions content/en/building/guides/forms/form-inputs.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: >
Data accessible from within CHT forms
relatedContent: >
building/reference/forms
building/reference/contact-page
building/contact-summary/contact-summary-templated
building/guides/tasks/pass-data-to-form
aliases:
Expand Down Expand Up @@ -87,7 +87,7 @@ Contact data is not available in forms created from the "Reports" tab.

### `contact-summary` data

`app` forms with a contact in context can access the contact-summary data associated with the contact. This is done by referencing an instance named `contact-summary`. E.g. `instance('contact-summary')/context/${variable}`. See [the reference documentation]({{< ref "building/reference/contact-page#care-guides" >}}) for more information.
`app` forms with a contact in context can access the contact-summary data associated with the contact. This is done by referencing an instance named `contact-summary`. E.g. `instance('contact-summary')/context/${variable}`. See [the reference documentation]({{< ref "building/contact-summary/contact-summary-templated#care-guides" >}}) for more information.

{{% alert title="Note" %}}
Contact summary data is not available in `contact` forms or in forms created from the "Reports" tab.
Expand Down
2 changes: 1 addition & 1 deletion content/en/building/guides/integrations/oppia.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ Below is a code snippet for a target configured for the educational modules:

### Contact Summary

In addition to targets, the user is able to see which specific modules they have completed, and view upcoming tasks and other general information on their profile. The section containing this information is known as the [contact summary]({{< ref "building/reference/contact-page" >}}). The contact summary has 3 main outputs: cards, fields, and context. Contact summary is defined in the `contact-summary.templated.js` file under the project folder.
In addition to targets, the user is able to see which specific modules they have completed, and view upcoming tasks and other general information on their profile. The section containing this information is known as the [contact summary]({{< ref "building/contact-summary/contact-summary-templated" >}}). The contact summary has 3 main outputs: cards, fields, and context. Contact summary is defined in the `contact-summary.templated.js` file under the project folder.

Cards are an array of objects which can be customized to group information viewed on a contact’s profile. The required properties of a card include:

Expand Down
2 changes: 1 addition & 1 deletion content/en/building/reference/extension-libs.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ This will create or update a document to CouchDB with an ID of `extension-libs`

#### CHT API

The function will now be available via the CHT API for [tasks]({{< ref "tasks" >}}), [targets]({{< ref "building/targets/targets-js" >}}), and [contact summary]({{< ref "contact-page" >}}) configurations.
The function will now be available via the CHT API for [tasks]({{< ref "tasks" >}}), [targets]({{< ref "building/targets/targets-js" >}}), and [contact summary]({{< ref "building/contact-summary/contact-summary-templated" >}}) configurations.

#### CHT xPath functions

Expand Down
2 changes: 1 addition & 1 deletion content/en/building/reference/forms/app.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ A CHT-enhanced version of the ODK XForm standard is supported.

Data needed during the completion of the form (eg patient's name, prior information) is passed into the `inputs` group. Reports that have at least one of `place_id`, `patient_id`, and `patient_uuid` at the top level will be associated with that contact.

{{< see-also page="building/reference/contact-page" anchor="care-guides" title="Passing contact data to care guides" >}}
{{< see-also page="building/contact-summary/contact-summary-templated" anchor="care-guides" title="Passing contact data to care guides" >}}

A typical form ends with a summary group (eg `group_summary`, or `group_review`) where important information is shown to the user before they submit the form.

Expand Down
6 changes: 3 additions & 3 deletions content/en/building/tutorials/application-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Complete the following tutorials:
- [Building App Forms]({{< ref "building/tutorials/app-forms" >}})
- [Building A Simple Task]({{< ref "building/tasks/simple-tasks" >}})
- [Building Target Widgets]({{< ref "building/targets/target-widgets" >}})
- [Building Contact Summary]({{< ref "building/tutorials/contact-summary" >}})
- [Building Contact Summary]({{< ref "building/contact-summary/contact-summary-overview" >}})

## Importance of testing your application
---
Expand Down Expand Up @@ -235,7 +235,7 @@ Contact summary consists of visible components such as [cards](https://docs.comm
Use [harness.getContactSummary()](https://docs.communityhealthtoolkit.org/cht-conf-test-harness/Harness.html#getContactSummary) method to get the [ContactSummary ](https://docs.communityhealthtoolkit.org/cht-conf-test-harness/global.html#ContactSummary)object, which has these properties: `fields`, `cards`, and `context`.
To test the contact summary fields added in the [previous tutorial]({{< ref "building/tutorials/contact-summary#3-export-fields" >}}), use the following test case:
To test the contact summary fields added in the [previous tutorial]({{< ref "building/contact-summary/contact-summary-overview#3-export-fields" >}}), use the following test case:
```js highlight
const contactSummary = await harness.getContactSummary();
Expand Down Expand Up @@ -279,7 +279,7 @@ expect(contactSummary.cards[0].fields).to.deep.equal(
]
);
```
If you follow [this code sample]({{< ref "building/reference/contact-page#code-samples" >}}) to create the pregnancy condition card, the pregnancy context can be tested this way:
If you follow [this code sample]({{< ref "building/contact-summary/contact-summary-templated#code-samples" >}}) to create the pregnancy condition card, the pregnancy context can be tested this way:
```js highlight
const summaryContext = harness.getContactSummary().context;
Expand Down
4 changes: 2 additions & 2 deletions content/en/building/tutorials/condition-cards.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: >
Building CHT application condition cards
relatedContent: >
building/contact-management
building/reference/contact-page#condition-cards
building/contact-summary/contact-summary-templated#condition-cards
aliases:
- /apps/tutorials/condition-cards
---
Expand Down Expand Up @@ -42,7 +42,7 @@ Create a `contact-summary.templated.js` file if it doesn't exist. (This may have

### 1. Add Dependencies and Variable Definitions

Add the following dependencies and variable definitions at the top of the file (some of them may have been added from the [contact summary tutorial]({{< ref "building/tutorials/contact-summary" >}})):
Add the following dependencies and variable definitions at the top of the file (some of them may have been added from the [contact summary tutorial]({{< ref "building/contact-summary/contact-summary-overview" >}})):

```javascript
const thisContact = contact;
Expand Down
2 changes: 1 addition & 1 deletion content/en/building/tutorials/death-reporting.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ You typically don't want users doing actions like "health assessment" for deceas

#### Condition card for "Date of Death"

On your [contact page]({{% ref "building/reference/contact-page" %}}) you may want to add a condition card to display the date of the patient's death.
On your [contact page]({{% ref "building/contact-summary/contact-summary-templated" %}}) you may want to add a condition card to display the date of the patient's death.

```javascript
const cards = [
Expand Down
2 changes: 1 addition & 1 deletion content/en/core/overview/db-schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: >
Schema for database objects
relatedContent: >
building/guides/database
building/reference/contact-page
building/contact-summary/contact-summary-templated
building/targets/targets-js
building/reference/tasks
---
Expand Down

0 comments on commit 56e552f

Please sign in to comment.