Custom Documents CSV API
Covered by this topic
Custom documents can be designed at the storage type level. When a layout is present in the system with module=Storage Type and name=
Existing Storage Types
A layout with module=Storage Type and name=
Process
- Determine the number of the storage type for which you want to create a custom layout. This can be done by looking either in the MySQL database or at the stg_DetailView[MAX_STGTYPES] array in storage.c (approx. line 1950).
To view the storage types in MySQL run the following query:
SELECT * FROM storage_types;
STORAGE_TYPE | FILE_EXT | CONTENT_TYPE | DESCRIPTION |
0 | txt | text/plain | Delete doc |
1 | txt | text/plain | Plain Text Document |
2 | rtf | text/richtext | RTF Document |
3 | png | image/png | PNG file |
4 | html | text/html | HTML file |
5 | html | text/html | IMG & TEXT/HTML file |
6 | doc | application/msword | WORD Document |
7 | tif | image/tiff | TIFF Documents |
8 | jpg | image/jpeg | JPEG Documents |
9 | bin | application/octet-stream | Binary Documents |
10 | dcm | application/dicom | DICOM Documents |
11 | htm | text/html | TASK |
12 | htm | text/html | Injection |
13 | htm | text/html | Lab Request |
14 | txt | text/plain | Pre-Formated Text |
15 | htm | text/html | Orders |
16 | htm | text/html | Mammo Tracking |
17 | application/pdf | PDF file | |
18 | xls | application/vnd.ms-excel | MS Excel |
19 | cda | application/x-hl7-cda | CDA Document |
20 | avi | video/x-msvideo | AVI Video Document |
21 | ccr | text/xml | CCR Document |
22 | mime | multipart/mixed | |
23 | htm | text/html | OCP Audio |
24 | htm | text/html | Pulmonary Function Test |
25 | bmp | image/x-bmp | BMP |
26 | x12 | application/edi-x12 | X12 Messages |
27 | xml | text/xml | XML |
- Create a new layout. Set the module=Storage Type. Set the name to be the value from the storage_type column of the storage_types table or the number shown in comments in storage.c. For example, a Lab Request is storage type 13. To create a layout for lab requests, name=13.
- Add the desired HTML to the layout. To replicate the information in the default document, follow the code in the appropriate function from the stg_DetailView array. For lab requests, this function is stg_DetailViewLabReq().
Info
These documents will only be rendered with a header if a custom header layout is created with module=Storage Type Header and name is the same as the storage type layout. Additionally, these layouts will override the default rendering for all documents in the system with that storage type.
Custom Storage Types
Storage types >= 1001 can be added to create a custom document rendered with a layout.
Process
- Insert a new storage type into the storage_types table.
<1001+>,,,);INSERT INTO storage_types (storage_type, file_ext, content_type, description) VALUES (
For example,
INSERT INTO storage_types (storage_type, file_ext, content_type, description) VALUES (1001,'html','text/html','Test new storage type');
- Add a new document with the new storage type you just created. This can be done by navigating to a patient’s chart and clicking the Add Document link. Add a text document and copy the id. Then manually update the document with that id to have your new storage type.
WHERE doc_id=;UPDATE documents SET storage_type=
You can also perform a manual insert into the documents table.
- Create a new layout. Set the module=Storage Type. Set the name to be the new storage type >= 1001.
- Add the desired HTML to the layout.
Info
These documents will only be rendered with a header if a custom header layout is created with module=Storage Type Header and name is the same as the storage type layout.
WebChart Documentation
Last Updated:
Last Build:
Fri, 24 Jan 2025 22:43:21 UTC
WikiGDrive Version: 0008bcbb1563384efe0a28ada6f97e9432e65f10