Customizing your Prescriptions

Discussion in 'Documentation & Training Resources' started by Jason, Dec 11, 2006.

  1. Jason

    Jason Developer / Handyman Staff Member

    Synapse is very powerful in that it allows many easy customizations of items such as Scripts, Requests, Letters, Invoices.

    Here is a quick tutorial on how to customize your prescriptions.

    Once you understand the (1) variables, (2) visible text, and (3) locations... it becomes quite easy !





  2. Jason

    Jason Developer / Handyman Staff Member

    This is what the prescription looks like when it is printed.

    Attached Files:

  3. Jason

    Jason Developer / Handyman Staff Member

    Here is the text in the >Custom>PostScript> Tab for creating this prescription

  4. Jason

    Jason Developer / Handyman Staff Member

    Custom/PostScript

    A template called "A4 script generic" which is below:
    The
    "at nxn" tells the printer where to place the following item on the
    page. The item can be a keyword such as "My-name", or "patient-table"
    which takes information from the database or configuration settings.
    Or, it can be text as long as there is a font directive before that.

    So, lets go thru this template line by line

    pagesize A4

    Set the pagesize to A4. Can be letter, or A5.

    font Times-BoldItalic 30

    Use the PostScript font, Times-BoldItalic in a 30 point size for the heading

    linewidth 1

    Use a linewidth of 1 point for any lines we draw. We are going to draw 3 lines in this template later on.


    at 190x750 My-Name

    On
    the page measured from the bottom left, place My-name at 190x750 points
    where there are 72 points per inch. My-name is set up in Settings.

    color (black)

    Use the color black for any printing until we change the color. Note the ( ).



    font Times-Roman 12


    Change the font to Times-Roman at 12 point size


    newpath at 75x725 line1


    Start
    a newpath ( ie. we've finished with the text now ), and at 75x725 place
    the text corresponding to Line1 of the doctors address in Settings.


    at 75x715 line2

    at 75x705 line3


    Print Line2 and Line3 of the doctors address

    at 440x725 "Reg: "

    At 440x725 put the text "Reg: " still using the same font as last set.


    at 465x725 medical-registration



    Now
    at 465x725 ( on the same y setting, but 25 points to the right of "Reg:
    " ) put the medical registration as taken from the doctor's Settings.

    at 445x715 "Ph: "

    at 465x715 ph

    at 445x705 "Fx: "

    at 465x705 fx


    Do similar for the phone and fax from Setttings



    at 75x680 "Date:" font Times-Bold at 105x680 today


    Put the text "Date: " and then change to a bold font before printing today's date.


    font Times-Roman 14

    Change to a larger font size of 14


    at 75x655 patient-table


    Now at 75x655, print the patient's address details as taken from the database.


    at 360x660 "Dob:" at 400x660 dob


    Print the date of birth


    newpath at 75x740 line 530x740
    newpath at 75x700 line 530x700


    Draw a couple of parallel lines across the page 75x740 to 530x740, and 75x700 to 530x700




    font Times-Roman 12


    Change to a 12 point font

    at 75x57
  5. Jason

    Jason Developer / Handyman Staff Member

    Note:

    Line1, Line2, Line3 correspond to the Lines in the >Settings> Tab.

    as seen below

    Attached Files:

  6. Jason

    Jason Developer / Handyman Staff Member

    By my calculations,

    On a A4 paper, with font size = 12, you can have 28 characters as a maximum for the drug name and your prescription allows a maximum of 27 drugs per prescription page.

    Attached Files:

  7. Jason

    Jason Developer / Handyman Staff Member

    Graham: Is there anyway to include images yet ? I want my prescriptions to look pretty.

    Which Postscript is being used in Synpase ?

    ( I want to look up the documentation )



    </pre><pre>Will those work ?</pre><pre></pre><pre></pre>

  8. Graham

    Graham Developer Staff Member

    If your image is in eps format, I may be able to do something about accommodating images.

  9. Jason

    Jason Developer / Handyman Staff Member

    what postscript ?

    what are the commands ?

  10. Graham

    Graham Developer Staff Member

    None at present, but if you have an EPS image, I can look at implementing the appropriate support for printing them.

  11. Jason

    Jason Developer / Handyman Staff Member

    what language is this ? is this a dialect you made up ?

    I can make .eps files easily.



    [​IMG]

  12. Graham

    Graham Developer Staff Member

    Yes, it's one of many domain specific languages I have implemented Synapse.

    It tries to be as close as possible to PostScript.

  13. Graham

    Graham Developer Staff Member

    Please email me the EPS file, and where you want it on the page .. and I'll see what I can do.

    Perhaps send me a mockup of what the page is supposed to look like.

  14. Graham

    Graham Developer Staff Member

    Just confirming that adding this code after the pagesize command line

    at 72x700 eps %logo.eps

    where logo.eps is the name of an EPS file, places an image on the page of the superbill as well.

    the syntax is

    at nxn eps %path-to-filename

    so, this is also correct

    at 100x600 eps %/c/synapse/images/mywatermark.eps

    where the file is in c:\synapse\images\mywatermark.eps
  15. Graham

    Graham Developer Staff Member

    On my hard drive in the c:\texmf directory, I found a sample eps file called demofig.eps which is a tiny cat sketch.

    The file header is this :
    So, the bounding box specifies that the image is to be placed on the page in the box described by the two corners 44x525 and 80x559

    I need to change my implementation so that it alters the origin of the bounding box so that it goes where we want the image, as otherwise it will appear on the page at the same place each time as described in the eps file.

    BTW, you could use an eps file to put your signature on the prescription.
  16. Graham

    Graham Developer Staff Member

    Try beta-8

    I was able to position the cat just on the signature line using this command, just before the showpage command.


    at 210x-450 eps %/c/texmf/demofig.eps

    Since the eps wants to position the image high on the page, I used a negative y offset to bring it down to where I wanted it.

    [​IMG]

  17. Jason

    Jason Developer / Handyman Staff Member

    Getting different results with different .eps files.


    (#1) my image rxheader.eps - greyscale

    I can place it where I want it. I have been trying it on the bottom.

    Problem #1 - it prints two pages, no matter what I do. regardless of where I put it on the page (end, middle). I think it is printing "too far to the right" and the second page is created by the image being too wide, not too long. It seems to mess up GSView as well. When it prints two pages, I can move to the second page (which is blank) but when I am on the second page, I can't move back to the first.


    Problem #2 - a smaller image doesnt print smaller, something is resizing it to fit the entire page width.




    (#2) with file: tiger.eps ( a coloured tiger picture )

    GSview 4.8 2006-02-25
    GPL Ghostscript 8.54 (2006-05-17)
    Copyright (C) 2006 artofcode LLC, Benicia, CA. All rights reserved.
    This software comes with NO WARRANTY: see the file PUBLIC for details.
    Displaying non DSC file C:/EMR/Client/www/script.ps
    Loading NimbusRomNo9L-MediItal font from C:\Program Files\gs\fonts/n021024l.pfb... 2398496 1043017 1908008 602065 2 done.
    Loading NimbusRomNo9L-Regu font from C:\Program Files\gs\fonts/n021003l.pfb... 2495568 1180005 1928104 610647 2 done.
    Loading NimbusRomNo9L-Medi font from C:\Program Files\gs\fonts/n021004l.pfb... 2632832 1315529 1928104 615342 2 done.
    Error: /syntaxerror in -file-
    Operand stack:

    Execution stack:

    %interp_exit .runexec2 --nostringval-- --nostringval--
    --nostringval-- 2 %stopped_push --nostringval--
    --nostringval-- false 1 %stopped_push 1 3 %oparray_pop
    1 3 %oparray_pop 1 3 %oparray_pop 1 3 %oparray_pop
    .runexec2 --nostringval-- --nostringval-- --nostringval-- 2
    %stopped_push
    Dictionary stack:
    --dict:1130/1686(ro)(G)-- --dict:0/20(G)-- --dict:74/200(L)--
    Current allocation mode is local

    --- Begin offending input ---
    0 moveto (Generic Substitution Permitted) show

    0 40 moveto

    gsave

    0 40 translate

    &permil;PNG

    



    IHDR
    &iquest; &Ccedil; &Ccedil;&ugrave;&yacute; tRNS &yuml; &yuml; &yuml;7X} bKGD &yuml; &yuml; &yuml;&frac12;&sect;&ldquo;
    IDATx&oelig;&igrave;}y@g&thorn;&divide;33IfrgB h@
    R&ntilde;@&Aacute; &laquo;6&Ocirc;&para;&ndash;V&copy;&Oslash;&Euml;&ordf;&raquo;&iacute;b&times;j&raquo;&Yacute;v+&shy;=&para;&raquo;&Otilde;&hellip;nw{h&Yacute;&Ecirc;&Ouml;&shy;&Ouml;&para;&para;&acirc;j&euml;]&permil;'E%T@&bdquo;(H&euro;pM&sup1;&oacute;&thorn;&ntilde;&agrave;rv&raquo;&Ucirc;&Yacute;&divide;&divide;&ugrave;+yf2W>&oacute;&frac12;&Yuml;&iuml;&fnof;x&frac12;^&eth;&Agrave;&Icirc;&iacute;&Ucirc;>&ucirc;&ucirc;'-&Iacute;&rdquo;&Aring;&euml;v&tilde;&shy;&sup3;&Otilde;)d&atilde;L
    hT&divide;&Ocirc;/&mdash;=&uacute;&auml;&acirc;PGP&laquo;&Otilde;Z&shy;&para;&igrave;&agrave;&frac34;&aelig;&rsaquo;7&macr;6&Uuml;s.!-&auml;&oacute;&ograve;&bdquo;&lsquo;&Eacute;&lsaquo;&ndash;,&Iacute;&Egrave;&Egrave;
    I&ograve;_K?&frac14;&yuml;&Dagger;[8|p&szlig;&fnof;&sup3;&sup2;F&circ;&deg;&trade;Cyt:N&ugrave;b&Aacute;S&Yacute;&Yacute;&Yacute;^&macr;&middot;&not;&not;&igrave;&yacute;&divide;&szlig;_&tilde;&divide;P&not;T&ograve;#&yuml;&rdquo;(&plusmn;0w&Icirc;=eee&yuml;&eacute;G2&thorn;=&THORN;&
  18. Jason

    Jason Developer / Handyman Staff Member

    I am using this program to make the .eps files.

    http://www.pdflib.com/download/free-software/jpeg2ps/



    FYI, GSView doesn't open the tiger.eps.

    But my Graphics Converter Pro program does.
  19. Jason

    Jason Developer / Handyman Staff Member

    You know about the yellow box in the Preview Window ?

    Attached Files:

  20. Graham

    Graham Developer Staff Member

    The yellow box is supposed to indicate where the image is to go .. but really it depends on where the EPS file says it goes.

    Why don't you post the first few lines of the EPS file so we can look at the settings.

Share This Page