<div class="page-content-wrapper">
    <div class="page-content all">
        <div class="row">
            <div class="col-md-12" style="padding-right: 0px; padding-left: 0px;">
                <div class="portlet box blue">
                    <div class="portlet-title" style="height: 5px">
                        <div class="caption">
                            <i class="fa fa-edit"></i> Antenatal visits NO.{$mainObj->g}
                        </div>
                        <div class="actions">
                            <a href="{$hosturl}/controllers/antenalvisit.php?ac=archive&patientid={$patientid}" class="btn btn-default btn-sm">
                                Archive pregnancy
                            </a>
                        </div>




                    </div>
                    <div class="portlet-body">


                        <table class="table table-striped table-hover table-bordered">
                            <thead>
                                <tr>
                                    <th class="col-md-2 wds5">
                                        LMP
                                    </th>
                                    <th class="col-md-2 wds5">
                                        EDD
                                    </th>
                                    <!--                                    <th class="col-md-2">
                                                                            IVF
                                                                        </th>-->
                                    <th class="col-md-4">
                                        Notes
                                    </th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td>
                                        <input type="text" class="form-control" value="{$mainObj->lmp}" readonly/>
                                    </td>
                                    <td>
                                        <input type="text" class="form-control" value="{$mainObj->eed}" readonly/>
                                    </td>
                                    <!--                                    <td>
                                                                            <input type="text" class="form-control" value="{$mainObj->ivf}" readonly/>
                                                                        </td>-->
                                    <td>
                                        {$mainObj->notes}
                                    </td>
                                </tr>
                            </tbody>
                        </table>




                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-md-12" style="padding-right: 0px; padding-left: 0px;">
                <div class="portlet box blue">
                    <div class="portlet-title" style="height: 5px">
                        <div class="caption">
                            <i class="fa fa-edit"></i> All visits
                        </div>

                        <div class="actions">
                            <a href="javascript:;" class="btn btn-default btn-sm" id="showDrugs" data-mainId="{$mainObj->id}" data-archive="1" data-controller="antenalvisit"> TTT</a>
                        </div>

                        <div class="actions">
                            <a href="javascript:;" class="btn btn-default btn-sm" id="showInv" data-mainId="{$mainObj->id}" data-archive="1"  data-controller="antenalvisit"> Lab</a>
                        </div>

                        <div class="actions">
                            <a href="javascript:;" class="btn btn-default btn-sm" id="addUS" data-mainId="{$mainObj->id}" data-archive="1">  US </a>
                        </div>


                    </div>
                    <div class="portlet-body" id="justfordrugs" >

                        <table class="table table-striped table-hover table-bordered" id="antenalvisit">
                            <thead>
                                <tr>
                                    <th class="col-md-2 wds9">
                                        Date
                                    </th>
                                    <th class="wds1">
                                        W
                                    </th>
                                    <th class="wds30">
                                        Complaint
                                    </th>
                                    {if $ProgramesettingData->diagnosshow eq 0}
                                    <th>
                                        Diagnosis
                                    </th>
                                    {/if}
                                    <th class="wds4">
                                        Wt
                                    </th>
                                    <th class="wds6">
                                        Bp
                                    </th>

                                    <th>
                                        Notes
                                    </th>

                                </tr>
                            </thead>
                            <tbody>
                                {if $allantenalvisitCount>0}
                                {foreach $allantenalvisit as $myObject}
                                <tr>
                                    <td>
                                        <input type="text" class="form-control" value="{$myObject->antenaldate}" readonly/>
                                    </td>

                                    <td>
                                        <label {if $myObject->dateFlag == 1}style="color: red;"{/if}>{$myObject->w}</label>
                                    </td>
                                    {if $ProgramesettingData->diagnosshow eq 0}
                                    <td>
                                        <input type="text" class="form-control" value="{foreach $allcomplaint as $comp}{if $comp->id|in_array:$myObject->compselect}{$comp->name}   {/if}{/foreach}" readonly/>

                                    </td>
                                    <td>
                                        <input type="text" class="form-control" value="{foreach $alldiagnosis as $mydiagnosis}{if $mydiagnosis->id|in_array:$myObject->select}{$mydiagnosis->name}  {/if}{/foreach}" readonly/>

                                    </td>
                                    {else}
                                    <td>
                                        <input type="text" class="form-control" value="{$myObject->complaint}" readonly/>
                                    </td>
                                    {/if}
                                    <td>
                                        <input type="text" class="form-control" value="{$myObject->wt}" readonly/>
                                    </td>
                                    <td>
                                        <input type="text" class="form-control bp_mask" value="{$myObject->bp}" readonly/>
                                    </td>


                                    <td>
                                        {$myObject->notes}
                                    </td>

                                </tr>

                                {/foreach}
                                {else}
                                <tr>
                                    <td style="padding: 3px;" colspan="6">
                                        <div align="center">
                                            NO DATA
                                        </div>

                                    </td>
                                </tr>
                                {/if}
                            </tbody>
                        </table>


                    </div>
                </div>
            </div>
        </div>
    </div>

</div>

<input type="hidden" id="patientId" value="{$patientid}"/>
<input type="hidden" id="mainAntenatalId" value="{$mainObj->id}"/>
<input type="hidden" id="controllName" value="antenalvisit"/>
<input type="hidden" id="iDsArray" value="{$iDsArray}"/>



<div class="modal fade" tabindex="-1" role="dialog" aria-hidden="false" data-backdrop="static" data-keyboard="false"   id="antPatientUS" style="min-width:1000px;">
    <div class="modal-dialog  modal-lg wds90">
        <div class="modal-content">
            <div class="modal-header">
                <h4 class="modal-title">  </h4>
            </div>
            <div class="modal-body">
                <div class="portlet-body form">
                    <div class="row">
                        <div class="col-md-12">
                            <div class="portlet blue-hoki box">
                                <div class="portlet-title" >
                                    <div class="caption"> Ultrasound </div>
                                </div>
                                <div class="portlet-body">

                                    <table class="table table-striped table-hover table-bordered" dir="ltr">
                                        <thead>
                                            <tr>
                                                <th>
                                                    #
                                                </th>
                                                <th>
                                                    Date
                                                </th>
                                                <th>
                                                    N(GA)
                                                </th>
                                                <th>
                                                    GS
                                                </th>
                                                <th>
                                                    CRL
                                                </th>
                                                <th>
                                                    FHR
                                                </th>
                                                <th>
                                                    BPD
                                                </th>

                                                <th>
                                                    FL
                                                </th>
                                                <th>
                                                    Placenta
                                                </th>

                                                <th>
                                                    FWT
                                                </th>
                                                <th>
                                                    Notes
                                                </th>

                                                <th>
                                                    {if $ProgramesettingData->displaydoctorname eq 1}Doctor{/if}
                                                </th>
                                            </tr>
                                        </thead>
                                        <tbody id="usantenatal">
                                            {assign var=i value=1}
                                            {foreach $allAntUS  as $aUs }
                                            <tr>
                                                <td>{$i}</td>

                                                <td>
                                                    <input type="text" class="form-control " readonly="" placeholder="Date"  value="{$aUs->date}"/>
                                                </td>
                                                <td>
                                                    <input type="text" class="form-control " disabled="" placeholder="N(GA)"  value="{$aUs->nga}">
                                                </td>
                                                <td>
                                                    <input type="text" class="form-control " disabled="" placeholder="GS" value="{$aUs->gs}">
                                                </td>
                                                <td>
                                                    <input type="text" class="form-control " disabled="" placeholder="CRL"  value="{$aUs->crl}">
                                                </td>
                                                <td>
                                                    <input type="text" class="form-control " disabled="" placeholder="FHR" value="{$aUs->fhr}">
                                                </td>
                                                <td>
                                                    <input type="text" class="form-control " disabled="" placeholder="BPD"  value="{$aUs->bpd}">
                                                </td>
                                                <td>
                                                    <input type="text" class="form-control " disabled="" placeholder="FL"  value="{$aUs->fl}">
                                                </td>
                                                <td>
                                                    <input type="text" class="form-control " disabled="" placeholder="Placenta"  value="{$aUs->placenta}">
                                                </td>
                                                <td>
                                                    <input type="text" class="form-control " disabled="" placeholder="FWT"  value="{$aUs->fwt}">
                                                </td>
                                                <td>
                                                    <input type="text" class="form-control " disabled="" placeholder="Notes"  value="{$aUs->notes}">
                                                </td>

                                                <td class="bold">
                                                    {if $ProgramesettingData->displaydoctorname eq 1}{$aUs->doctorname}{/if}
                                                </td>
                                            </tr>
                                            {capture assign=i}{$i+1}{/capture}
                                            {/foreach}
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn default" id="closemodel" data-dismiss="modal"> Close</button>

                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<!--------------------------------------------------------------------------- show Investigation Model-------------------------------------------------------------------------------------->
<div class="modal fade" tabindex="-1" role="dialog" aria-hidden="false" data-backdrop="static" data-keyboard="false"   id="showPatientInvestigation" style="min-width:1000px;">
    <div class="modal-dialog  modal-lg wds90">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
                <h4 class="modal-title">  </h4>
            </div>
            <div class="modal-body">
                <div class="portlet-body form">
                    <div class="row">
                        <div class="col-md-12">
                            <div class="portlet blue-hoki box">
                                <div class="portlet-title">
                                    <div class="caption"> Investigations  </div>
                                </div>
                                <div class="portlet-body">
                                    <div  id="showInvs">
                                        <table class="table table-striped table-hover table-bordered">
                                            <thead>
                                                <tr>
                                                    <th> <div align="center">Date </div></th>
                                                    <th colspan="3"> <div align="center">Investigations </div></th>
                                                </tr>
                                            </thead>

                                        </table>
                                    </div>
                                    <div  id="inv_divShow">

                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn default" id="closemodel" data-dismiss="modal"> Close</button>

                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>



<!---------------------------------------------------------------------------show Drugs Model-------------------------------------------------------------------------------------->
<div class="modal fade" tabindex="-1" role="dialog" aria-hidden="false" data-backdrop="static" data-keyboard="false"   id="showPatientDrugs" style="min-width:1000px;z-index: 10049;">
    <div class="modal-dialog  modal-lg wds90">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
                <h4 class="modal-title">  </h4>
            </div>
            <div class="modal-body">
                <div class="portlet-body form">
                    <div class="row">
                        <div class="col-md-12">
                            <div class="portlet blue-hoki box">
                                <div class="portlet-title" >
                                    <div class="caption"> Prescriptions </div>
                                </div>
                                <div class="portlet-body" id="showPrescriptions">

                                    <table class="table table-striped table-hover table-bordered">
                                        <thead>
                                            <tr>
                                                <th>
                                                    Date
                                                </th>
                                                <th>
                                                    Drug Name
                                                </th>
                                                <th>
                                                    Print
                                                </th>
                                                <th>
                                                    {if $ProgramesettingData->displaydoctorname eq 1}Doctor{/if}
                                                </th>
                                            </tr>
                                        </thead>

                                    </table>

                                </div>
                                <div id="drugPrintShow">

                                </div>
                            </div>
                        </div>
                        <div class="modal-footer">

                            <button type="button" class="btn default" id="closemodel" data-dismiss="modal"> Close</button>

                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
