User Tools

Site Tools


pracro:praxisd

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
pracro:praxisd [2011/04/18 11:46] devapracro:praxisd [2011/12/08 10:16] deva
Line 26: Line 26:
 </code> </code>
  
-=====API===== +======API====== 
-GET+=====GET=====
-<code> +
-/praxisd/1.0/user/authenticate +
-/praxisd/1.0/user/get_name_by_id +
-/praxisd/1.0/dokmenu/get_all_by_cpr +
-/praxisd/1.0/dokmenu/get_by_cpr_and_name +
-</code> +
- +
-POST: +
-<code> +
-/praxisd/1.0/journal/add +
-/* /praxisd/1.0/patient/update */ +
-/praxisd/1.0/patient/add_sogeord +
-/praxisd/1.0/aftale/update +
-/praxisd/1.0/aftale/add +
-/praxisd/1.0/aftale/delete +
-/praxisd/1.0/dokmenu/add +
-/praxisd/1.0/dokmenu/delete +
-</code> +
 ====Get Journal By CPR==== ====Get Journal By CPR====
 <code>/praxisd/1.0/journal/get_by_cpr</code> <code>/praxisd/1.0/journal/get_by_cpr</code>
Line 397: Line 378:
 </praxisd> </praxisd>
 </code> </code>
 +
 +
 +====Authenticate====
 +<code>/praxisd/1.0/user/authenticate</code>
 +Validate a username and password against the pcpraxis user db. NOTE: this is not needed in order to communicate with the server. Not event POSTs.
 +Parameters:
 +  * user the username
 +  * pass the password
 +//Returns// http errorcode 401 (unauthorized) if not successful 200 (OK) otherwise.
 +
 +====Get Name by UserID====
 +<code>/praxisd/1.0/user/get_name_by_id</code>
 +Parameters:
 +  * user the username to look up.
 +//Returns// the plaintext utf-8 name connected with the userid.
 +
 +====Get All DokMenu by CPR====
 +<code>/praxisd/1.0/dokmenu/get_all_by_cpr</code>
 +Shows the complete dokmenu for a given patient id.
 +Parameters:
 +  * cpr the patient id.
 +//Returns// xml structure with dokmenu entries\\
 +<code xml>
 +<?xml version="1.0" encoding="UTF-8"?>
 +<praxisd version="1.0">
 +  <dokmenu cpr="nnnnnnnnn">
 +    <group>XXXXXXXXXXXX</group>
 +    <subject>XXXXXXXXXXXXXXXXXXXXXX</subject>
 +    <filename filesize="1371" date="2010-05-05 09:25:10">XXXXXXXX</filename>
 +  </dokmenu>
 +   .
 +   .
 +   .
 +</praxisd>
 +</code>
 +
 +====Get DokMenu by Name and CPR====
 +<code>/praxisd/1.0/dokmenu/get_by_cpr_and_name</code>
 +Fetch contents of a file in the dokmenu by using its filename.
 +Parameters:
 +  * cpr the patient id.
 +  * name the name of the file to be fetched.
 +//Returns// the raw unformatted contents of the file.
 +
 +
 +
 +=====POST=====
 +
 +====Add To Journal====
 +<code>/praxisd/1.0/journal/add</code>
 +Add text to the journal.
 +<code xml>
 +<praxisd version="1.0">
 +  <journal cpr="nnnnnnnnnn" [replace="true|false"] [header="true|false"]>Text to add properly formatted</journal>
 +</praxisd>
 +</code>
 +
 +====Update Patient====
 +<code>/* /praxisd/1.0/patient/update */</code>
 +FIXME Not yet implemented.
 +
 +====Add Sogeord to Patient====
 +<code>/praxisd/1.0/patient/add_sogeord</code>
 +<code xml>
 +<praxisd version="1.0">
 +  <addsogeord cpr="nnnnnnnnnn">
 +    <sogeord sogenr="XYZUVW" date="2009-08-17">sogtxt</sogeord>
 +     .
 +     .
 +     .
 +  </addsogeord>
 +</praxisd>
 +</code>
 +
 +
 +====Update Aftale====
 +<code>/praxisd/1.0/aftale/update</code>
 +In the xml both the old and the new contents must be present in order for the server to be able to verify that no changes were made since the original was last fetched.
 +<code xml>
 +<praxisd version="1.0">
 +  <aftale date="2009-08-17 11:12:00" calendar="1" original="true">
 +    <cpr>nnnnnnnnnnn</cpr>
 +    <cref>Blabla!</cref>
 +    <cmrk>x</cmrk>
 +    <ctxt>Text and bla</ctxt>
 +    <cres>More bla</cres>
 +  </aftale>
 +  <aftale date="2009-09-20 10:10:00" calendar="2" [original="false"]>
 +    <cpr>nnnnnnnnnnn</cpr>
 +    <cref>Newbla!</cref>
 +    <cmrk>y</cmrk>
 +    <ctxt>New Text and bla</ctxt>
 +    <cres>New bla</cres>
 +  </aftale>
 +</praxisd>
 +</code>
 +NOTE: All fields are truncated to their respective database column sizes without notice.
 +
 +On success the server replies with the http statuscode 200: OK
 +
 +Some of the fail states are:
 +  * The updated aftale is identical to the one already in the database. This does **not** result in an error, but will leave the database untouched.
 +  * The current aftale in the database is no identical to the aftale marked "original" in the xml. This will result in a http errror 400: Bad Request with the body "Source changed".
 +  * The original does not exist in the database (is was deleted or never added). The server responds with a http err 400: Bad request and body: "IsamError 10200".
 +
 +====Add Aftale====
 +<code>/praxisd/1.0/aftale/add</code>
 +<code xml>
 +<praxisd version="1.0">
 +  <aftale date="2009-09-20 10:10:00" calendar="2">
 +    <cpr>nnnnnnnnnn</cpr>
 +    <cref>Newbla!</cref>
 +    <cmrk>y</cmrk>
 +    <ctxt>New Text and bla</ctxt>
 +    <cres>New bla</cres>
 +  </aftale>
 +</praxisd>
 +</code>
 +
 +====Delete Aftale====
 +<code>/praxisd/1.0/aftale/delete</code>
 +Delete the matching calendar entry.
 +<code xml>
 +<praxisd version="1.0">
 +  <aftale date="2009-09-20 10:10:00" calendar="2"/>
 +</praxisd>
 +</code>
 +
 +
 +====Add File to DokMenu====
 +<code>/praxisd/1.0/dokmenu/add</code>
 +Upload file to dokmenu.
 +<code xml>
 +<praxisd version="1.0">
 +  <dokmenu cpr="nnnnnnnnnn">
 +    <group>Group text bla</group>
 +    <subject>Subject text bla</subject>
 +    <file [name="88888888.333" | extension="333"] [date="YYYY-MM-DD HH:MM:SS"] [base64="true|false"]>file content</file>
 +  </dokmenu>
 +</praxisd>
 +</code>
 +
 +====Delete File from DokMenu====
 +<code>/praxisd/1.0/dokmenu/delete</code>
 +Delete a file from the dokmenu.
 +<code xml>
 +<praxisd version="1.0">
 +  <dokmenu cpr="nnnnnnnnnn" name="filename.ext"/>
 +</praxisd>
 +</code>
 +
pracro/praxisd.txt · Last modified: 2011/12/08 10:18 by deva