If you do it via sql, you'll need to insert an encounter row and 5 obs rows
(x200).

Something along the lines of:

1.
insert into encounter (patient_id, encounter_datetime, location_id, ...)
select [new patient id], encounter_datetime, location_id, ...
from encounter where encounter_id = [id of encounter to copy]

2. There's some way of getting the last-generated-autonumber in mysql. you'd
need to call that

3.
insert into obs (encounter_id, concept_id, value_numeric, ...)
select [last generated autonumber], concept_id, value_numeric
from obs where encounter_id = [id of encounter to copy]

4. repeat 199 more times

If it were me, I'd use web services. In theory the call described in
RESTWS-141 <https://tickets.openmrs.org/browse/RESTWS-141> works now.
(Though I think you need to change /ws/rest to /ws/rest/v1.)

-Darius

On Thu, Aug 25, 2011 at 6:25 AM, Blaya, Joaquin Andres <
[email protected]> wrote:

> The forms have 5 questions and I'm using xforms.
>
> Is there any way to do this via SQL since that's what I know for now.
>
> If not, which of the web services or HL7 messages would be easier?
>
> Thanks,
> Joaquin
>
> ___________________________________________________________________
> Chief Technology Officer, eHealth Systems Chile
> Research Fellow, Harvard Medical School/Partners In Health
> Moderator, GHDOnline.org
> -----Original Message-----
> From: [email protected] [mailto:[email protected]] On Behalf
> Of Darius Jazayeri
> Sent: Wednesday, August 24, 2011 18:51
> To: [email protected]
> Subject: Re: [OPENMRS-IMPLEMENTERS] Copy a filled out form to multiple
> patients
>
> How big are the forms, and how complex?
>
> You could try to use web services for this. Basically repeat the same web
> service call 200 times, changing only the patientId value in the json.
>
> If you were using HTML Form Entry, you could do 200 HTTP POSTs, that are
> identical except for the patientId parameter...
>
> With infopath formentry (and maybe xforms) you could post 200 HL7 messages
> identical except for the PID segment...
>
>
> -Darius
>
>
> On Wed, Aug 24, 2011 at 3:20 PM, Blaya, Joaquin Andres <
> [email protected]> wrote:
>
>
>        Hi,
>
>        We're doing a demo server and I would like to have the same form
> filled out the exact same way for 200 demo patients.  Is there a way I could
> do that either through SQL or through a module?  I'd want everything to be
> identical including encounter datetime, location, etc..
>
>
>        Thanks,
>
>
>
>        Joaquin
>
>
>
>        ___________________________________________________________________
>
>        Chief Technology Officer, eHealth Systems Chile
>
>        Research Fellow, Harvard Medical School/Partners In Health
>
>         Moderator, GHDOnline.org <http://www.GHDOnline.org>
>
>
>
> ________________________________
>
>        Click here to unsubscribe 
> <mailto:[email protected]?body=SIGNOFF%20openmrs-implement-l>
>  from OpenMRS Implementers' mailing list
>
>
> ________________________________
>
> Click here to unsubscribe 
> <mailto:[email protected]?body=SIGNOFF%20openmrs-implement-l>
>  from OpenMRS Implementers' mailing list
>
> _________________________________________
>
> To unsubscribe from OpenMRS Implementers' mailing list, send an e-mail to
> [email protected] with "SIGNOFF openmrs-implement-l" in the
>  body (not the subject) of your e-mail.
>
> [mailto:[email protected]?body=SIGNOFF%20openmrs-implement-l]
>

_________________________________________

To unsubscribe from OpenMRS Implementers' mailing list, send an e-mail to 
[email protected] with "SIGNOFF openmrs-implement-l" in the  body 
(not the subject) of your e-mail.

[mailto:[email protected]?body=SIGNOFF%20openmrs-implement-l]

Reply via email to