Design for Import Spreadsheet module to import multiple observations for the same concept with different dates and display them in HTML or XForms

classic Classic list List threaded Threaded
5 messages Options
Joaquín Blaya Joaquín Blaya
Reply | Threaded
Open this post in threaded view
|

Design for Import Spreadsheet module to import multiple observations for the same concept with different dates and display them in HTML or XForms

We're in the process of designing how the spreadsheet import module will create a new encounter (and optionally be able to show it in a form). We've run into a question which is how to import multiple observations with different observation dates for the same concept in the same encounter.

An example is in the testdata excel that comes with the import module, where for the concept weight, you have two observations, each with a different date. So our idea was
1. if the user chooses to create an encounter with the import, the encounter_datetime is the datetime of the import
2. if the user chooses to put an obs_datetime it will associate it with that specific obs. Otherwise, it will put the obs_datetime of all obs the same as the encounter_datetime

The questions I have are 
  1. Is there a way to show multiple observations for the same concept (perhaps even with different obs_datetime) within the same form?  I can see that it can be done for an encounter and when you click on Edit it shows you all of the obs with their datetime if it's been changed, but can it be done in HTML Form or XForm?
  2. Must each observation have a obs_datetime, or if the obs_datetime is null it looks at the encounter_datetime?  This is to define if the module should automatically fill in each obs_datetime or not
  3. Is there a way in HTML Form Entry and XForms to show the obs_datetime within the form?
Thanks, 

Joaquín
___________________________________________________________________
Gerente de Desarrollo, eHealth Systems
Research Fellow, Escuela de Medicina de Harvard
Moderador, GHDOnline.org

[hidden email] from OpenMRS Developers' mailing list
Burke Mamlin Burke Mamlin
Reply | Threaded
Open this post in threaded view
|

Re: Design for Import Spreadsheet module to import multiple observations for the same concept with different dates and display them in HTML or XForms

Joaquín,

obs.obs_datetime should always be set and should be the best approximate to the point in time that the observation occurred (i.e., the physiologic time for laboratories, the time that the question was asked for questionnaire questions, etc.).  If the obs doesn't have an independent time (true in most cases), then use the timestamp of the encounter.

If you have groups of observations for which you are automatically creating encounters, I would suggest setting the timestamp of the encounter (encounter.encounter_datetime) based on the observations rather than the time of import (e.g., the earliest timestamp amongst the group of observations).  The encounter.date_created will reflect the time of import.  So, in your option #1, use the earliest timestamp amongst the group of observations being imported as an encounter as the encounter_datetime.

-Burke

On Sun, May 6, 2012 at 10:47 AM, Joaquín Blaya <[hidden email]> wrote:
We're in the process of designing how the spreadsheet import module will create a new encounter (and optionally be able to show it in a form). We've run into a question which is how to import multiple observations with different observation dates for the same concept in the same encounter.

An example is in the testdata excel that comes with the import module, where for the concept weight, you have two observations, each with a different date. So our idea was
1. if the user chooses to create an encounter with the import, the encounter_datetime is the datetime of the import
2. if the user chooses to put an obs_datetime it will associate it with that specific obs. Otherwise, it will put the obs_datetime of all obs the same as the encounter_datetime

The questions I have are 
  1. Is there a way to show multiple observations for the same concept (perhaps even with different obs_datetime) within the same form?  I can see that it can be done for an encounter and when you click on Edit it shows you all of the obs with their datetime if it's been changed, but can it be done in HTML Form or XForm?
  2. Must each observation have a obs_datetime, or if the obs_datetime is null it looks at the encounter_datetime?  This is to define if the module should automatically fill in each obs_datetime or not
  3. Is there a way in HTML Form Entry and XForms to show the obs_datetime within the form?
Thanks, 

Joaquín


[hidden email] from OpenMRS Developers' mailing list
Dave Thomas Dave Thomas
Reply | Threaded
Open this post in threaded view
|

Re: Design for Import Spreadsheet module to import multiple observations for the same concept with different dates and display them in HTML or XForms

hey joaquin.  here are more answers to your three questions, for htmlforms.

1.  htmlforms allow you to use the same concept multiple times, but if that concept is grouped with other concepts, then you need to put each group in its own distinct obsgroup.

For example, say you ask the following two questions multiple times on an intake form after a patient transfer (I'm making this up, but just roll with it):  'previous cd4 count', 'lab where test was performed'.  If for a given patient you want to enter more than one of these pairs, you MUST put each pair in its own distinct obsgroup -- otherwise, you won't know which test result corresponds to which lab.

If you're thinking about using htmlform schemas to generate data import templates, this is straightforward for 'flat' htmlforms.  The hard part will be if you want to fully support obsGroups -- which would mean representing N-depth obsGroup heirarchies in auto-generated templates.   (Although if you have a use case involving obsGroups at all, it probably can be handled with just 1 level of obsGroups (like infopath)).

And, to get at an htmlform's schema, i've always done this with code -- you start a FormEntrySession using the form you're interested in and a fake patient, and then you can navigate the FormEntrySessions' schema objects -- there's a getSchema method in there somewhere.

2.  if you don't specify obs_datetime explicitly, these default to encounter_datetime

3.  htmlforms allow you to add the showDate attribute for any obs tag, which will render a date field for that obs that is mapped to obs.obs_datetime.  So its up to the form designer to expose this or not.

d

On Sun, May 6, 2012 at 8:49 AM, Burke Mamlin <[hidden email]> wrote:
Joaquín,

obs.obs_datetime should always be set and should be the best approximate to the point in time that the observation occurred (i.e., the physiologic time for laboratories, the time that the question was asked for questionnaire questions, etc.).  If the obs doesn't have an independent time (true in most cases), then use the timestamp of the encounter.

If you have groups of observations for which you are automatically creating encounters, I would suggest setting the timestamp of the encounter (encounter.encounter_datetime) based on the observations rather than the time of import (e.g., the earliest timestamp amongst the group of observations).  The encounter.date_created will reflect the time of import.  So, in your option #1, use the earliest timestamp amongst the group of observations being imported as an encounter as the encounter_datetime.

-Burke

On Sun, May 6, 2012 at 10:47 AM, Joaquín Blaya <[hidden email]> wrote:
We're in the process of designing how the spreadsheet import module will create a new encounter (and optionally be able to show it in a form). We've run into a question which is how to import multiple observations with different observation dates for the same concept in the same encounter.

An example is in the testdata excel that comes with the import module, where for the concept weight, you have two observations, each with a different date. So our idea was
1. if the user chooses to create an encounter with the import, the encounter_datetime is the datetime of the import
2. if the user chooses to put an obs_datetime it will associate it with that specific obs. Otherwise, it will put the obs_datetime of all obs the same as the encounter_datetime

The questions I have are 
  1. Is there a way to show multiple observations for the same concept (perhaps even with different obs_datetime) within the same form?  I can see that it can be done for an encounter and when you click on Edit it shows you all of the obs with their datetime if it's been changed, but can it be done in HTML Form or XForm?
  2. Must each observation have a obs_datetime, or if the obs_datetime is null it looks at the encounter_datetime?  This is to define if the module should automatically fill in each obs_datetime or not
  3. Is there a way in HTML Form Entry and XForms to show the obs_datetime within the form?
Thanks, 

Joaquín


[hidden email] from OpenMRS Developers' mailing list


[hidden email] from OpenMRS Developers' mailing list
Joaquín Blaya Joaquín Blaya
Reply | Threaded
Open this post in threaded view
|

Re: Design for Import Spreadsheet module to import multiple observations for the same concept with different dates and display them in HTML or XForms

In reply to this post by Burke Mamlin
Thanks Burke, that resolves question 2.  Any suggestions for questions 1 and 3?
  1. Is there a way to show multiple observations for the same concept (perhaps even with different obs_datetime) within the same form?  I can see that it can be done for an encounter and when you click on Edit it shows you all of the obs with their datetime if it's been changed, but can it be done in HTML Form or XForm?

  2. Is there a way in HTML Form Entry and XForms to show the obs_datetime within the form?

Joaquín
___________________________________________________________________
Gerente de Desarrollo, eHealth Systems
Research Fellow, Escuela de Medicina de Harvard
Moderador, GHDOnline.org


On Sun, May 6, 2012 at 11:49 AM, Burke Mamlin <[hidden email]> wrote:
Joaquín,

obs.obs_datetime should always be set and should be the best approximate to the point in time that the observation occurred (i.e., the physiologic time for laboratories, the time that the question was asked for questionnaire questions, etc.).  If the obs doesn't have an independent time (true in most cases), then use the timestamp of the encounter.

If you have groups of observations for which you are automatically creating encounters, I would suggest setting the timestamp of the encounter (encounter.encounter_datetime) based on the observations rather than the time of import (e.g., the earliest timestamp amongst the group of observations).  The encounter.date_created will reflect the time of import.  So, in your option #1, use the earliest timestamp amongst the group of observations being imported as an encounter as the encounter_datetime.

-Burke


On Sun, May 6, 2012 at 10:47 AM, Joaquín Blaya <[hidden email]> wrote:
We're in the process of designing how the spreadsheet import module will create a new encounter (and optionally be able to show it in a form). We've run into a question which is how to import multiple observations with different observation dates for the same concept in the same encounter.

An example is in the testdata excel that comes with the import module, where for the concept weight, you have two observations, each with a different date. So our idea was
1. if the user chooses to create an encounter with the import, the encounter_datetime is the datetime of the import
2. if the user chooses to put an obs_datetime it will associate it with that specific obs. Otherwise, it will put the obs_datetime of all obs the same as the encounter_datetime

The questions I have are 
  1. Is there a way to show multiple observations for the same concept (perhaps even with different obs_datetime) within the same form?  I can see that it can be done for an encounter and when you click on Edit it shows you all of the obs with their datetime if it's been changed, but can it be done in HTML Form or XForm?
  2. Must each observation have a obs_datetime, or if the obs_datetime is null it looks at the encounter_datetime?  This is to define if the module should automatically fill in each obs_datetime or not
  3. Is there a way in HTML Form Entry and XForms to show the obs_datetime within the form?
Thanks, 

Joaquín


[hidden email] from OpenMRS Developers' mailing list


[hidden email] from OpenMRS Developers' mailing list
Friedman, Roger (CDC/CGH/DGHA) (CTR) Friedman, Roger (CDC/CGH/DGHA) (CTR)
Reply | Threaded
Open this post in threaded view
|

Re: Design for Import Spreadsheet module to import multiple observations for the same concept with different dates and display them in HTML or XForms

In reply to this post by Joaquín Blaya

Joaquin --

     If I read you correctly, the form is a cumulative form which shows multiple encounters.  This is not going to map so well onto a form, although it might map onto a flow sheet.

Saludos, Roger

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Joaquín Blaya
Sent: Sunday, May 06, 2012 10:47 AM
To: [hidden email]
Subject: [OPENMRS-DEV] Design for Import Spreadsheet module to import multiple observations for the same concept with different dates and display them in HTML or XForms

 

We're in the process of designing how the spreadsheet import module will create a new encounter (and optionally be able to show it in a form). We've run into a question which is how to import multiple observations with different observation dates for the same concept in the same encounter.

 

An example is in the testdata excel that comes with the import module, where for the concept weight, you have two observations, each with a different date. So our idea was

1. if the user chooses to create an encounter with the import, the encounter_datetime is the datetime of the import

2. if the user chooses to put an obs_datetime it will associate it with that specific obs. Otherwise, it will put the obs_datetime of all obs the same as the encounter_datetime

 

The questions I have are 

  1. Is there a way to show multiple observations for the same concept (perhaps even with different obs_datetime) within the same form?  I can see that it can be done for an encounter and when you click on Edit it shows you all of the obs with their datetime if it's been changed, but can it be done in HTML Form or XForm?
  2. Must each observation have a obs_datetime, or if the obs_datetime is null it looks at the encounter_datetime?  This is to define if the module should automatically fill in each obs_datetime or not
  3. Is there a way in HTML Form Entry and XForms to show the obs_datetime within the form?

Thanks, 

Joaquín
___________________________________________________________________
Gerente de Desarrollo, eHealth Systems
Research Fellow, Escuela de Medicina de Harvard
Moderador, GHDOnline.org


[hidden email] from OpenMRS Developers' mailing list


[hidden email] from OpenMRS Developers' mailing list