Build modified streamline images

The official image from streamline does not currently work for the arm64
platform. As a temporary measure, the source code and docker build scripts
have been lifted from the official images and are used to build locally.

Some additional modifications are made to reduce overall image size, these
are documented in docker/README.md
This commit is contained in:
2024-03-10 16:17:50 -07:00
parent 2ffc3c408a
commit a424394109
13506 changed files with 1860172 additions and 6 deletions
@@ -0,0 +1,52 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/html5-editor/bootstrap-wysihtml5.css') }}" rel="stylesheet">
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('patient_episode.edit_claim_number') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('resources.dashboard') }}</a></li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
@include('flash::message')
<div class="white-box">
{{ Form::model($episode, ['method' => 'PUT', 'route' => ['patient_episodes.update',$episode], 'data-toggle' => 'validator']) }}
<div class="form-group">
{{ Form::label('claim_number', __('finance.claim_number')) }}
{{ Form::text('claim_number', $episode->claim_number, ['class' => 'form-control compulsory', 'required']) }}
{{ Form::hidden('episode_id', $episode_id) }}
<div class="help-block with-errors"></div>
</div>
{{ Form::button(__('resources.submit'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10']) }}
{{ Form::button(__('resources.cancel'),['type'=>'reset','class'=>'btn btn-default waves-effect waves-light']) }}
{{ Form::close() }}
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/js/validator.js') }}"></script>
<script type="text/javascript" src="{{ asset('elite/bower_components/html5-editor/wysihtml5-0.3.0.js') }}"></script>
<script type="text/javascript" src="{{ asset('elite/bower_components/html5-editor/bootstrap-wysihtml5.js') }}"></script>
<script>
$(document).ready(function () {
$('.textarea_editor').wysihtml5();
});
</script>
@endpush
@@ -0,0 +1,443 @@
<!DOCTYPE html>
<html lang="{{ app()->getLocale() }}">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" type="image/png" sizes="16x16" href="{{ asset('uploads/streamline/color/streamline_icon-02.png') }}">
<title>{{ config('app.name', 'Inpatient Bill - Stre@mline') }}</title>
<!-- Bootstrap Core CSS -->
<link href="{{ asset('bootstrap/css/bootstrap.min.css') }}" rel="stylesheet">
<style>
body{
font-size: 0.8em;
}
/*thead, tfoot { display: table-row-group }*/
thead {
display: table-header-group;
}
tfoot {
display: table-row-group;
}
tr {
page-break-before: always;
page-break-after: always;
page-break-inside: avoid !important;
}
</style>
</head>
<body>
<div class="container-fluid">
@include('layouts.header_pdf_print')
<h5 class="heading" style="text-align: center;">{{ __('patient_file.patient_episode_summary') }}</h5>
<table class="table table-light table-sm table-borderless">
<tr>
<th width="20%">{{ __('patient_file.patient_number') }}</th>
<td width="30%">{{ $patient->number}}</td>
<th width="15%" scope="row">{{ __('patient_file.category') }}</th>
<td>
{{ get_name($patient->category_id, 'id', 'name', 'patient_categories') }}
</td>
</tr>
<tr>
<th scope="row">{{ __('patient_file.patient_names') }}</th>
<td>{{ $patient->first_name}} {{ $patient->last_name}}</td>
<th scope="row">{{ __('patient_file.residence') }}</th>
<td>{{ patient_residence($patient->id) }}</td>
</tr>
<tr>
<th scope="row">{{ __('patient_file.age') }}</th>
<td><?php echo \Carbon\Carbon::parse($patient->date_of_birth)->age; ?> {{ __('patient_file.years') }}</td>
<th scope="row">{{ __('patient_file.gender') }}</th>
<td><?php echo $patient->gender == 1 ? __('patient_file.male') : __('patient_file.female') ?></td>
</tr>
<tr>
<th>{{ __('patient_file.episode_date') }}</th>
<td><?php echo \Carbon\Carbon::parse($episode->created_at)->format('d M Y h:i a'); ?></td>
<th scope="row">{{ __('patient_file.outcome') }}</th>
<td>
@if($consultation && !is_null($consultation->outcome_id))
@if($consultation->outcome_id == 3)
{{ $outcomes[$consultation->outcome_id] . ' on (' . streamline_date($consultation->followup_when) . ')' }}
@elseif($consultation->outcome_id == 5)
<code> {{ $outcomes[$consultation->outcome_id] . ' on (' . streamline_date($consultation->died_on) . ')' }} </code>
@else
{{ $outcomes[$consultation->outcome_id] ?? "" }}
@endif
@elseif (!empty($antenatal_data->outcome_id))
@if($antenatal_data->outcome_id == 3)
{{ $outcomes[$antenatal_data->outcome_id] . ' on (' . streamline_date($antenatal_data->followup_when) . ')' }}
@elseif($antenatal_data->outcome_id == 5)
<code> {{ $outcomes[$antenatal_data->outcome_id] . ' on (' . streamline_date($antenatal_data->died_on) . ')' }} </code>
@else
{{ $outcomes[$antenatal_data->outcome_id] ?? "" }}
@endif
@endif
</td>
</tr>
</table>
@if($consultation)
<table class="table table-sm table-bordered">
<thead class="thead-light">
<tr>
<th>{{ __('patient_file.diagnosis') }}</th>
<th>{{ __('patient_file.diagnosis_by') }}</th>
</tr>
</thead>
<?php
$primary_diagnosis = $consultation->primary_diagnosis;
$other_diagnoses_string = $consultation->other_diagnoses;
$other_diagnoses_array = unserialize($other_diagnoses_string);
?>
<tbody>
<tr>
<td>{{ $diagnoses[$primary_diagnosis] ?? "" }}</td>
<td>
@if (!is_null($consultation->consultation_done_by))
{{ get_full_name($consultation->consultation_done_by, 'id', 'first_name', 'last_name', 'users')}}
@elseif(!is_null($consultation->updated_by))
{{ get_full_name($consultation->updated_by, 'id', 'first_name', 'last_name', 'users')}}
@else
{{ get_full_name($consultation->created_by, 'id', 'first_name', 'last_name', 'users')}}
@endif
</td>
</tr>
@if(is_array($other_diagnoses_array))
@for($i = 0; $i < count($other_diagnoses_array); $i++)
@if($other_diagnoses_array[$i] != "")
<tr>
<td>{{ $diagnoses[$other_diagnoses_array[$i]] ?? "" }}</td>
<td></td>
</tr>
@endif
@endfor
@endif
</tbody>
</table>
@if(!is_null($consultation->comments))
<table class="table table-sm table-bordered">
<thead class="thead-light">
<tr><th>{{ __('patient_episode.comments') }}</th></tr>
</thead>
<tbody>
<tr><td>{!! nl2br(e($consultation->comments)) !!}</td></tr>
</tbody>
</table>
@endif
@if(!is_null($consultation->history_comments))
<table class="table table-sm table-bordered">
<thead class="thead-light">
<tr><th>{{ __('patient_episode.history_comments') }}</th></tr>
</thead>
<tbody>
<tr><td>{!! nl2br(e($consultation->history_comments)) !!}</td></tr>
</tbody>
</table>
@endif
@if(!is_null($consultation->clinic_examination_comments))
<table class="table table-sm table-bordered">
<thead class="thead-light">
<tr><th>{{ __('patient_episode.clinic_examination_comments') }}</th></tr>
</thead>
<tbody>
<tr><td>{!! nl2br(e($consultation->clinic_examination_comments)) !!}</td></tr>
</tbody>
</table>
@endif
@if(!is_null($consultation->investigation_and_management_plan_comments))
<table class="table table-sm table-bordered">
<thead class="thead-light">
<tr><th>{{ __('patient_episode.inv_manage_plan_comment') }}</th></tr>
</thead>
<tbody>
<tr><td>{!! nl2br(e($consultation->investigation_and_management_plan_comments)) !!}</td></tr>
</tbody>
</table>
@endif
@endif
@if($antenatal_data)
<table class="table table-sm table-bordered">
<thead class="thead-light">
<tr>
<th>{{ __('patient_file.diagnosis') }}</th>
{{-- <th>{{ __('patient_file.diagnosis_by') }}</th> --}}
</tr>
</thead>
<?php
$primary_diagnosis = $antenatal_data->primary_diagnosis;
$other_diagnoses_array = explode(',', $antenatal_data->other_diagnoses);
?>
<tbody>
<tr>
<td>{{ $diagnoses[$primary_diagnosis] ?? "" }}</td>
{{-- <td>
@if (!is_null($antenatal_data->consultation_done_by))
{{ get_full_name($antenatal_data->consultation_done_by, 'id', 'first_name', 'last_name', 'users')}}
@elseif(!is_null($antenatal_data->updated_by))
{{ get_full_name($antenatal_data->updated_by, 'id', 'first_name', 'last_name', 'users')}}
@else
{{ get_full_name($antenatal_data->created_by, 'id', 'first_name', 'last_name', 'users')}}
@endif
</td> --}}
</tr>
@if(is_array($other_diagnoses_array))
@for($i = 0; $i < count($other_diagnoses_array); $i++)
@if($other_diagnoses_array[$i] != "")
<tr>
<td>{{ $diagnoses[$other_diagnoses_array[$i]] ?? "" }}</td>
<td></td>
</tr>
@endif
@endfor
@endif
</tbody>
</table>
@if(!is_null($antenatal_data->comments))
<table class="table table-sm table-bordered">
<thead class="thead-light">
<tr><th>{{ __('patient_episode.comments') }}</th></tr>
</thead>
<tbody>
<tr><td>{!! nl2br(e($antenatal_data->comments)) !!}</td></tr>
</tbody>
</table>
@endif
@if(!is_null($antenatal_data->history_comments))
<table class="table table-sm table-bordered">
<thead class="thead-light">
<tr><th>{{ __('patient_episode.history_comments') }}</th></tr>
</thead>
<tbody>
<tr><td>{!! nl2br(e($antenatal_data->history_comments)) !!}</td></tr>
</tbody>
</table>
@endif
@if(!is_null($antenatal_data->clinic_examination_comments))
<table class="table table-sm table-bordered">
<thead class="thead-light">
<tr><th>{{ __('patient_episode.clinic_examination_comments') }}</th></tr>
</thead>
<tbody>
<tr><td>{!! nl2br(e($antenatal_data->clinic_examination_comments)) !!}</td></tr>
</tbody>
</table>
@endif
@if(!is_null($antenatal_data->investigation_and_management_plan_comments))
<table class="table table-sm table-bordered">
<thead class="thead-light">
<tr><th>{{ __('patient_episode.inv_manage_plan_comment') }}</th></tr>
</thead>
<tbody>
<tr><td>{!! nl2br(e($antenatal_data->investigation_and_management_plan_comments)) !!}</td></tr>
</tbody>
</table>
@endif
@endif
<div class="row">
@if(count($opd_investigations) > 0)
<div class="col">
<table class="table table-sm table-bordered">
<thead class="thead-light">
<tr>
<th>{{ __('patient_file.investigation') }}</th>
<th>{{ __('patient_file.result') }}</th>
<th>{{ __('patient_file.comment') }}</th>
</tr>
</thead>
<tbody>
@if(count($opd_investigations) > 0)
@for($i = 0; $i < count($opd_investigations['name']); $i++)
@if(isset($opd_investigations['name'][$i]))
<tr>
<td>{{ $opd_investigations['name'][$i] }}</td>
<td>
@if (!empty($opd_investigations['type'][$i]))
<strong><code>See attached</code></strong>
@else
{{ $opd_investigations['value'][$i] }}
@endif
</td>
<td>{{ $opd_investigations['comment'][$i] }}</td>
</tr>
@endif
@endfor
@endif
</tbody>
</table>
</div>
@endif
@if(count($ordered_procedures) > 0)
<div class="col">
<table class="table table-sm table-bordered">
<thead class="thead-light">
<tr><th>{{ __('patient_episode.procedure_name') }}</th></tr>
</thead>
<tbody>
@foreach($ordered_procedures as $procedure)
@php
$procedure_ids = explode(',', $procedure->procedure_id);
@endphp
@foreach ($procedure_ids as $id)
<tr>
<td>{{ $procedures[$id] ?? "" }}</td>
</tr>
@endforeach
@endforeach
</tbody>
</table>
</div>
@endif
</div>
<br>
<div class="row">
@if(count($ordered_sundries) > 0)
<div class="col">
<table class="table table-sm table-bordered">
<thead class="thead-light">
<tr>
<th>{{ __('insurance_reports.sundry_name') }}</th>
<th>{{ __('patient_episode.quantity') }}</th>
</tr>
</thead>
<tbody>
@foreach($ordered_sundries as $sundry)
@php
$sundry_ids = explode(',', $sundry->sundries_id);
$sundry_amounts = explode(',', $sundry->quantity);
@endphp
@for($i = 0; $i < count($sundry_ids); $i++)
<tr>
<td>{{ $sundries[$sundry_ids[$i]] ?? "" }}</td>
<td>{{ $sundry_amounts[$i] ?? "" }}</td>
</tr>
@endfor
@endforeach
</tbody>
</table>
</div>
@endif
@if(count($ordered_services) > 0)
<div class="col">
<table class="table table-sm table-bordered">
<thead class="thead-light">
<tr>
<th>{{ __('patient_episode.services') }}</th>
<th>{{ __('patient_episode.quantity') }}</th>
</tr>
</thead>
<tbody>
@foreach($ordered_services as $ordered_service)
@php
$service_ids = explode(',', $ordered_service->service_id);
$service_amounts = explode(',', $ordered_service->quantity);
@endphp
@for($i = 0; $i < count($service_ids); $i++)
<tr>
<td>{{ $services[$service_ids[$i]] ?? "" }}</td>
<td>{{ $service_amounts[$i] ?? "" }}</td>
</tr>
@endfor
@endforeach
</tbody>
</table>
</div>
@endif
</div>
<br>
<div class="row">
@if(count($treatments) > 0)
<div class="col">
<table class="table table-bordered table-sm">
<thead class="thead-light">
<tr>
<th>{{ __('patient_file.treatment') }}</th>
<th>{{ __('patient_file.dosage_freq') }}</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($treatments as $treatment)
<?php
$drugs_array = explode(",", $treatment->drugs);
$dosage_array = explode(",", $treatment->doses);
$dosage2_array = explode(",", $treatment->dose2);
$frequencies_array = explode(",", $treatment->frequencies);
$duration_array = explode(",", $treatment->durations);
$quantity_dispensed_array = explode(",", $treatment->quantities_dispensed);
$total_drug_price = 0;
$instructions_array = explode(",", $treatment->instruction);
?>
@for ($x = 0; $x < count($drugs_array); $x++)
<?php
$drug_details = \Streamline\Models\Drug::find($drugs_array[$x]);
if (!$drug_details) {
continue;
}
$drug_form_name = get_name($drug_details->form_id, "id", "name", "unit_of_measure");
$drug_unit = get_name($drug_details->unit_id, "id", "name", "drug_units");
$drug_strength = $drug_details->strength;
$treatment_dosage = $dosage_array[$x] ?? "";
$treatment_strength = $drug_strength ?? "";
?>
<tr>
<td>
{{ get_name($drugs_array[$x], 'id', 'name', 'drugs') }}
</td>
<td>
({{ $dosage_array[$x] }} {!! $drug_unit !!} &nbsp;&nbsp; {{ get_name($frequencies_array[$x], 'id', 'name', 'dosage_frequencies') }})
</td>
<td>
{{ $duration_array[$x] }}
</td>
</tr>
@endfor
@endforeach
</tbody>
</table>
</div>
@endif
</div>
@if (is_add_stamp_feature_enabled() && !empty($hospitalInfo->stamp))
<table class="table table-borderless">
<tbody>
<tr>
<td style="text-align: center">
<img style="max-width: 300px; max-height: 150px;" src="{{ asset($hospitalInfo->stamp) }}" class="img-fluid mx-auto d-block mx-3" alt="{{ $hospitalInfo->name}} stamp">
</td>
</tr>
</tbody>
</table>
@endif
</div>
</body>
</html>
@@ -0,0 +1,940 @@
@extends('layouts.main')
@push('styles')
<style type="text/css">
#t_header th {
background-color: #708090;
color: #000;
}
.color-tr{
background: #FFFF99;
}
.admitted_row_color{
background: #d9edf7;
}
.theatre_row_color{
background: #f2e6ff;
}
.appointment_row_color{
background: #e4e0a8;
}
.aTable tr {
background-color: #DDD;
}
.table_no_padding td{
padding: 4px;
}
</style>
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('patient_episode.patient_episodes') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('patient_episode.dashboard') }}</a></li>
<li><a href="{{ route('patients.index') }}">{{ __('patient_episode.patients') }}</a></li>
<li class="active">{{ __('patient_episode.episodes') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="row">
<div class="col-sm-12">
@include('patients::allergies.header')
</div>
</div>
<br/>
<div class="row">
<div class="col-sm-12">
@include('patients::patient_episodes.menu')
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
{{ Form::open(['route' => 'patient_episodes.route_patient_episode', 'id' => 'episodesForm']) }}
{{ Form::hidden('patient_id', $patient->id, ['id' => 'patient_id']) }}
<div class="white-box">
@include('flash::message')
@if(Auth::user()->can('merge-patient-episodes'))
<p>
<a class="btn btn-warning btn-sm btn-rounded" style="background-color: #d4984a; float:right" target="_blank" href="{{ url('episode_merge_preview') }}"><strong>{{ __('patient_episode.merge_episodes') }}</strong></a><br>
</p>
@endif
<div class="table-responsive">
<table class="table color-table success-table">
<thead>
<tr>
<th>{{ __('patient_episode.episode_date') }}</th>
<th>{{ __('patient_episode.clinic') }}</th>
<th>{{ __('patient_episode.primary_diagnosis') }}</th>
<th>{{ __('patient_episode.other_diagnosis') }}</th>
<th>{{ __('patient_episode.consultation_by') }}</th>
<th>{{ __('patient_episode.comments') }}</th>
<th>{{ __('patient_episode.select') }}</th>
</tr>
</thead>
<tbody>
@foreach($patient_episodes as $patient_episode)
@php
$episode_id = $patient_episode->id;
$created_at = Carbon\Carbon::parse($patient_episode->created_at);
$triage_id = $patient_episode->triage_id;
$anc = \DB::table('ante_natal_clinic_followups')->where([['episode_id', $episode_id],['patient_id', $patient_episode->patient_id]])->first();
$consultation_id = !empty($anc->primary_diagnosis)? $anc->primary_diagnosis:$patient_episode->consultation_id;
$primary_diagnosis_id = '';
$other_diagnoses_ids = '';
$triage_comment = '';$other_diagnoses_explode =[];
$consultation_comment = '';
$clinic = (isset($clinics[$patient_episode->clinic_id]) && !is_null($patient_episode->clinic_id)) ? $clinics[$patient_episode->clinic_id] : '';
$primary_diagnosis = '';
$other_diagnoses = '';
$triage_and_consultation_comments = '';
@endphp
@if (!empty($consultation_id))
@php
$primary_diagnosis_id = !empty($anc->primary_diagnosis)? $anc->primary_diagnosis: get_name($consultation_id, 'id', 'primary_diagnosis', 'consultations');
$other_diagnoses_ids = !empty($anc->other_diagnoses)? explode(',',$anc->other_diagnoses): trim(get_name($consultation_id, 'id', 'other_diagnoses', 'consultations'));
$consultation_comment = !empty($anc->comments)? trim($anc->comments): trim(get_name($consultation_id, 'id', 'comments', 'consultations'));
$consultation_comment = clean_streamline_database_output($consultation_comment);
$triage_comment = !is_null($triage_id) ? trim(get_name($triage_id, 'id', 'comments', 'triage')) : '';
$triage_and_consultation_comments = '<b>Triage: </b>'.$triage_comment.' '.'<br><b>Consultation: </b>'.$consultation_comment;
@endphp
@else
@php
$temporary_consultation_id = get_name($patient_episode->id, 'episode_id', 'id', 'temporary_consultations');
@endphp
@if ($temporary_consultation_id != 'N/A')
@php
$primary_diagnosis_id = get_name($temporary_consultation_id, 'id', "primary_diagnosis", 'temporary_consultations');
$other_diagnoses_ids = trim(get_name($temporary_consultation_id, 'id', 'other_diagnoses', 'temporary_consultations'));
$consultation_comment = trim(get_name($temporary_consultation_id, 'id', 'comments', 'temporary_consultations'));
@endphp
@endif
@endif
@php
$primary_diagnosis = isset($diagnoses[$primary_diagnosis_id]) ? $diagnoses[$primary_diagnosis_id] : '';
if($other_diagnoses_ids != 'N/A' && $other_diagnoses_ids != '') $other_diagnoses_explode = (!is_array($other_diagnoses_ids))? unserialize($other_diagnoses_ids) : $other_diagnoses_ids;
$other_diagnoses = "";
for($s = 0; $s < count($other_diagnoses_explode); $s++) $other_diagnoses .= isset($diagnoses[$other_diagnoses_explode[$s]]) ? $diagnoses[$other_diagnoses_explode[$s]] . ", " : '';
@endphp
<tr id='my_row{{ $episode_id }}'>
<td>
<a href="#" style="color: #0099CC">{{ streamline_date_time($patient_episode->created_at) }} </a>
<br>
<small>{{ __('patient_episode.started_by') }}</small>
<small style="color: blue">{{ get_full_name($patient_episode->created_by, "id", "first_name", "last_name", "users") }}</small>
@if(check_if_episode_is_a_followup($patient_episode->id))
@php
$original_episode = \Streamline\Models\PatientEpisode::find($patient_episode->parent_episode_id);
@endphp
<small style="color: green"><br>({{ __('patient_episode.review_from') }} {{ $original_episode ? streamline_date($original_episode->created_at) : '' }})</small>
@endif
@if(Auth::user()->can('delete-empty-episode') && is_episode_safe_to_delete($patient_episode->id))
<br>
<br>
<a class="btn btn-danger btn-sm" href="/patient_episodes/delete_episode/{{ $patient_episode->id }}" onclick="return confirm('Are you sure you want to delete this episode?')">{{ __('patient_episode.remove_episode') }}</a>
@endif
</td>
<td>
@if( Auth::user()->can('view-patient-episode-clinic-from-patient-home'))
{{ $clinic }}
@endif
</td>
<td>
@if( Auth::user()->can('view-patient-episode-primary-diagnoses'))
{{ $primary_diagnosis }}
@endif
</td>
<td class="hidden-phone">
@if( Auth::user()->can('view-patient-episode-other-diagnoses'))
{!! read_more($other_diagnoses, 'other_diagnoses_short' . $patient_episode->id, 'other_diagnoses_long' . $patient_episode->id) !!}
<div id="other_diagnoses_long{{ $patient_episode->id }}" style="display: none;">
{!! $other_diagnoses !!}<br/>
<a class="read_more" style="color : #0099CC;" onclick= "hide('other_diagnoses_long{{ $patient_episode->id }}');show('other_diagnoses_short{{ $patient_episode->id }}');">{{ __('patient_episode.read_less') }}</a>
</div>
@endif
</td>
<td class="hidden-phone">
@php
$consultation_done_by = !empty($anc->created_by)? $anc->created_by :get_doctor_who_completed_episode_consultation($patient_episode->id);
@endphp
@if(!is_null($consultation_done_by))
{{ get_full_name($consultation_done_by, "id", "first_name", "last_name", "users") }}
@endif
@if($patient_episode->episode_type == 1)
<span>{{ __('patient_flow_monitoring.lab_self_request') }}</span>
@endif
</td>
<td class="hidden-phone">
{!! read_more($triage_and_consultation_comments, 'short_comment' . $patient_episode->id, 'long_comment' . $patient_episode->id) !!}
<div id="long_comment{{ $patient_episode->id }}" style="display: none;">
{!! $triage_and_consultation_comments !!}<br/>
<a class="read_more" style="color : #0099CC;" onclick= "hide('long_comment{{ $patient_episode->id }}');show('short_comment{{ $patient_episode->id }}');">{{ __('patient_episode.read_less') }}</a>
</div>
</td>
<td>
<input type="radio" onchange="show('menu1'), hide('theatre_menu'), hide('menu2'), hide('pic1'), hide('menu_maternity')" class="radio-option center" name="episode_id" id="episode_id_{{ $patient_episode->id }}" value="{{ $patient_episode->id }}" />
</td>
</tr>
@php
$inpatient_info = get_all_first(['episode_id' => $patient_episode->id, 'patient_id' => $patient->id], 'inpatient_info');
$maternity_ward_id = get_name("maternity", "slug", "id", "wards");
@endphp
@if ($inpatient_info != 'N/A')
<tr id='my_row2{{ $inpatient_info->episode_id }}' class="admitted_row_color">
<td style='background-color: white; font-size: smaller;'>
@if($inpatient_info->discharged)
<a style="color: #0099CC">{{ __('patient_episode.discharged') }} on {{ streamline_date($inpatient_info->discharged_on) }}</a>
<br><small style="color: blue">By {{ get_full_name($inpatient_info->discharged_by, "id", "first_name", "last_name", "users") }}</small>
@else
<a style="color: #0099CC">{{ __('patient_episode.admitted') }} on {{ streamline_date($inpatient_info->admitted_on) }}</a>
<br><small style="color: blue">By {{ get_full_name($inpatient_info->created_by, "id", "first_name", "last_name", "users") }}</small>
@endif
</td>
<td> {{ get_name($inpatient_info->ward_id, "id", "name", "wards") }} </td>
@php
$sec_diagnoses = (!is_null($inpatient_info->other_diagnoses) && !is_null(unserialize($inpatient_info->other_diagnoses))) ? array_values(unserialize($inpatient_info->other_diagnoses)) : [] ;
$sec_diagnosis = "";
for ($s = 0; $s < count($sec_diagnoses); $s++) $sec_diagnosis .= get_name($sec_diagnoses[$s], "id", "name", "diagnoses") . ", ";
@endphp
<td>
@if( Auth::user()->can('view-patient-episode-primary-diagnoses'))
{{ get_name($inpatient_info->primary_diagnosis, "id", "name", "diagnoses") }}
@endif
</td>
<td class="hidden-phone">
@if( Auth::user()->can('view-patient-episode-other-diagnoses'))
{!! read_more($sec_diagnosis, 'sec_diagnosis_short' . $episode_id, 'sec_diagnosis_long' . $episode_id) !!}
<div id="sec_diagnosis_long{{ $episode_id }}" style="display: none;">
{!! $sec_diagnosis !!}<br/>
<a class="read_more" style="color : #0099CC;" onclick= "hide('sec_diagnosis_long{{ $episode_id }}');show('sec_diagnosis_short{{ $episode_id }}');">{{ __('patient_episode.read_less') }}</a>
</div>
@endif
</td>
<td class="hidden-phone">
@php
$consultation_done_by = !empty($anc->created_by)? $anc->created_by :get_doctor_who_has_done_episode_consultation($patient_episode->patient_id, $patient_episode->id);
@endphp
@if(!is_null($consultation_done_by))
{{ get_full_name($consultation_done_by, "id", "first_name", "last_name", "users") }}
@endif
</td>
<td> {{ $inpatient_info->comments }}</td>
<td>
@if(get_name($inpatient_info->ward_id, "id", "slug", "wards") == "maternity")
<input type="radio" onchange="show('menu_maternity'), hide('theatre_menu'), hide('menu1'), hide('menu2'), hide('pic1')" class="radio-option-inpatient center" name="episode_id" id="episode_id" value="{{ $patient_episode->id }}"/>
@else
<input type="radio" onchange="show('menu2'), hide('theatre_menu'), hide('menu_maternity'), hide('menu1'), hide('pic1')" class="radio-option-inpatient center" name="episode_id" id="episode_id" value="{{ $patient_episode->id }}"/>
@endif
</td>
</tr>
@endif
@php
$theatre_information = does_episode_have_theatre_information($patient_episode->id);
@endphp
@if ($theatre_information)
<tr id='my_row3' class="theatre_row_color">
<td style='background-color: white; font-size: smaller;'>
@if($theatre_information['surgery_completed'])
<span style="color: green">{{ __('patient_episode.surgery_complete') }}</span>
@else
<span style="color: red">{{ __('patient_episode.surgery_not_complete') }}</span>
@endif
<br>
@if($theatre_information['anaesthesia_completed'])
<span style="color: green">{{ __('patient_episode.anaesthesia_complete') }}</span>
@else
<span style="color: red">{{ __('patient_episode.anaesthesia_not_complete') }}</span>
@endif
</td>
<td>{{ __('patient_episode.procedure') }}: {{ $theatre_information['procedure_name'] }}</td>
<td>{{ __('patient_episode.surgery_type') }}: {{ $theatre_information['surgery_type'] }}</td>
<td>{{ __('patient_episode.outcome') }}: {{ $theatre_information['outcome'] }}</td>
<td class="hidden-phone">
@php
$consultation_done_by = !empty($anc->created_by)? $anc->created_by :get_doctor_who_has_done_episode_consultation($patient_episode->patient_id, $patient_episode->id);
@endphp
@if(!is_null($consultation_done_by))
{{ get_full_name($consultation_done_by, "id", "first_name", "last_name", "users") }}
@endif
</td>
<td>{{ $theatre_information['comments'] }}</td>
<td>
<input type="radio" onchange="show('theatre_menu'), hide('menu_maternity'), hide('menu1'), hide('menu2'), hide('pic1')" class="radio-option-inpatient center" name="episode_id" id="episode_id" value="{{ $patient_episode->id }}"/>
</td>
</tr>
@endif
@php
$episode_appointment = get_all_first(['episode_id' => $patient_episode->id, 'patient_id' => $patient->id], 'patient_appointments');
@endphp
@if($episode_appointment != 'N/A' && $episode_appointment->appointment_fulfilled == 1)
<tr id='my_row4' class="appointment_row_color">
<td style='background-color: white; font-size: small;'>
@if($episode_appointment->appointment_fulfilled == 1)
<span style="color: red">{{ __('patient_episode.follow_up') }}</span>
@else
<span style="color: red">{{ __('patient_episode.follow_up_complete') }}</span>
@endif
</td>
<td><b>{{ __('patient_episode.clinic') }}:</b> {{ get_name($episode_appointment->clinic_allocation, 'id', 'name', 'clinics') }}</td>
<td><b>{{ __('patient_episode.appointment_date') }}:</b> {{ is_null($episode_appointment->appointment_date) ? '' : streamline_date($episode_appointment->appointment_date) }}</td>
<td><b>{{ __('patient_episode.in_charge') }}:</b> {{ get_full_name($episode_appointment->incharge_id, 'id', 'first_name', 'last_name', 'users') != "ALL STAFF" ? get_full_name($episode_appointment->incharge_id, 'id', 'first_name', 'last_name', 'users') : "N/A" }}</td>
<td class="hidden-phone">
@php
$consultation_done_by = !empty($anc->created_by)? $anc->created_by : get_doctor_who_has_done_episode_consultation($patient_episode->patient_id, $patient_episode->id);
@endphp
@if(!is_null($consultation_done_by))
{{ get_full_name($consultation_done_by, "id", "first_name", "last_name", "users") }}
@endif
</td>
<td>{{ $episode_appointment->comments }}</td>
<td>
<input type="radio" onchange="show('menu1'), hide('theatre_menu'), hide('menu2'), hide('pic1'), hide('menu_maternity')" class="radio-option center" name="episode_id" id="episode_id_{{ $patient_episode->id }}" value="{{ $patient_episode->id }}" />
</td>
</tr>
@endif
@endforeach
</tbody>
</table>
</div>
</div>
<div class="" id="menu1" style="display: none;">
<div class="row">
<div class="col-sm-2">
@if(Auth::user()->can('perform-triage'))
<button type="submit" name="submit" class="btn btn-success btn-sm col-sm-12" value="triage">{{ __('patient_episode.triage') }}</button>
@endif
</div>
<div class="col-sm-2">
@if(Auth::user()->can('create-consultation'))
<button type="submit" name="submit" class="btn btn-success btn-sm col-sm-12" value="consultation" id="consultation_button">{{ __('patient_episode.consultation') }}</button>
@endif
</div>
<div class="col-sm-2">
@if(Auth::user()->can('create-prescription'))
<button type="submit" name="submit" class="btn btn-success btn-sm col-sm-12" value="prescription">{{ __('patient_episode.prescriptions') }}</button>
@endif
</div>
<div class="col-sm-2">
@if(Auth::user()->can('order-for-investigations'))
<div class="btn-group dropup m-r-10 col-sm-12">
<button aria-expanded="false" data-toggle="dropdown" class="btn btn-sm btn-success dropdown-toggle waves-effect waves-light btn-block" type="button">{{ __('patient_episode.investigations') }} <span class="caret"></span></button>
<ul role="menu" class="dropdown-menu">
<li><button type="submit" name="submit" class="btn btn-link w-100 h-100" value="investigations" >{{ __('patient_episode.investigations') }}</button></li>
<li class="divider"></li>
<li><a href="/investigations/view_historical_results_labs/{{ $patient->id }}" style="text-align:center; color:black" class="btn btn-default btn-sm btn-link">{{ __('patient_episode.historical_investigations') }}</a></li>
</ul>
</div>
@endif
</div>
<div class="col-sm-2">
@if(Auth::user()->can('order-for-procedures'))
<button type="submit" name="submit" class="btn btn-success btn-sm btn-block" value="procedure">{{ __('patient_episode.procedures') }}</button>
@endif
</div>
<div class="col-sm-2">
<button class="btn btn-success btn-sm btn-block" type="submit" name="submit" value="patient_document">{{ __('patient_episode.add_document') }}</button>
</div>
</div>
<br>
<div class="row">
<div class="col-sm-2">
@if(Auth::user()->can('order-for-sundries'))
<button type="submit" name="submit" class="btn btn-success btn-sm btn-block" value="sundries">{{ __('patient_episode.sundries') }}</button>
@endif
</div>
<div class="col-sm-2">
@if(Auth::user()->can('view-eye-clinic'))
<button type="submit" name="submit" class="btn btn-success btn-sm btn-block" value="eye_clinic">{{ __('patient_episode.eye_clinic') }}</button>
@endif
</div>
<div class="col-sm-2">
@if(Auth::user()->can('view-episode-summary'))
<button type="button" class="btn btn-primary btn-sm btn-block" id="patient_file">{{ __('patient_episode.episode_summary') }}</button>
@endif
</div>
<div class="col-sm-2">
@if(Auth::user()->can('transfer-patient-internally'))
<div class="btn-group dropup m-r-10 col-sm-12">
<button aria-expanded="false" data-toggle="dropdown" class="btn btn-primary dropdown-toggle btn-block" type="button">{{ __('patient_episode.internal_transfer') }} <span class="caret"></span></button>
<ul role="menu" class="dropdown-menu">
<li><button type="button" class="btn btn-primary btn-sm btn-block" id="internal_transfer">{{ __('patient_episode.clinic_transfer') }}</button></li>
<li><button type="button" class="btn btn-info btn-sm btn-block" id="doctor_transfer">{{ __('patient_episode.doctor_transfer') }}</button></li>
</ul>
</div>
@endif
</div>
<div class="col-sm-2">
@if(Auth::user()->can('view-death-report'))
<button type="submit" name="submit" id="death_report_btn" value="death_report_btn" class="btn btn-sm btn-block btn-inverse" >NIRA {{ __('patient_episode.death_report') }}</button>
@endif
</div>
<div class="col-sm-2">
@if(Auth::user()->can('create-theatre-surgery') || Auth::user()->can('create-theatre-anaesthesia'))
<div class="btn-group dropup m-r-10 col-sm-12">
<button aria-expanded="false" data-toggle="dropdown" class="btn btn-info dropdown-toggle waves-effect waves-light col-sm-12" type="button">{{ __('patient_episode.theatre') }} <span class="caret"></span></button>
<ul role="menu" class="dropdown-menu">
<li><button type="submit" name="submit" value="create_anaesthetics" class="btn btn-default btn-sm btn-link">{{ __('patient_episode.theatre_anaesthetics') }}</button></li>
<li><button type="submit" name="submit" value="anaesthetics_history" class="btn btn-default btn-sm btn-link">{{ __('patient_episode.historical_anaesthetics') }}</button></li>
<li><button type="submit" name="submit" value="create_surgery" class="btn btn-default btn-sm btn-link">{{ __('patient_episode.theatre_surgery') }}</button></li>
<li><button type="submit" name="submit" value="surgery_index" class="btn btn-default btn-sm btn-link">{{ __('patient_episode.historical_surgeries') }}</button></li>
</ul>
</div>
@endif
</div>
</div>
<br>
<div class="row">
<div class="col-sm-2">
@if(Auth::user()->can('perform-triage-without-etat'))
<button type="submit" name="submit" class="btn btn-success btn-sm col-sm-12" value="triage_without_etat">{{ __('patient_episode.triage_without') }} ETAT</button>
@endif
</div>
<div class="col-sm-2">
@if(Auth::user()->can('create-consultation-with-notes'))
<button type="submit" name="submit" class="btn btn-success btn-sm col-sm-12" value="consultation_with_notes">{{ __('patient_episode.consultation_with_notes') }}</button>
@endif
</div>
<div class="col-sm-2">
@if(Auth::user()->can('drug-refill'))
<button type="submit" name="submit" class="btn btn-success btn-sm col-sm-12" value="drug_refill">{{ __('patient_episode.drug_refill') }}</button>
@endif
</div>
@if(Auth::user()->can('drug-refill') && is_patient_category_pay_later($patient->category_id))
<div class="col-sm-2">
<button type="submit" name="submit" class="btn btn-success btn-sm col-sm-12" value="edit_claim_number">{{ __('patient_episode.edit_claim_number') }}</button>
</div>
@endif
<div class="col-sm-2">
@if(Auth::user()->can('order-for-services-from-patient-home'))
<button type="submit" name="submit" class="btn btn-success btn-sm col-sm-12" value="services">{{ __('patient_episode.services') }}</button>
@endif
</div>
<div class="col-sm-2">
@if(Auth::user()->can('record-staff-service-performance'))
<button type="submit" name="submit" class="btn btn-success btn-sm col-sm-12" value="record_all_items">{{ __('patient_episode.order_multiple_items') }}</button>
@endif
</div>
<div class="col-sm-2">
@if(Auth::user()->can('admit-patient-from-patient-home'))
<button type="button" name="admit_patient" class="btn btn-success btn-sm col-sm-12" id="admit_patient">{{ __('patient_episode.admit_patient') }}</button>
@endif
</div>
</div>
</div>
<!-- maternity menu at the shown at the bottom -->
<div class="white-box" id="menu_maternity" style="display: none;">
<div class="row">
@if(Auth::user()->can('view-maternity-admission'))
<div class="col-sm-2">
<button name="submit" value="maternity_admission" class="btn btn-success btn-sm btn-block">{{ __('patient_episode.maternity_admission') }}</button>
</div>
@endif
@if(Auth::user()->can('view-delivery-record'))
<div class="col-sm-2">
<button name="submit" value="delivery_record" class="btn btn-success btn-sm btn-block" >{{ __('patient_episode.delivery_record') }}</button>
</div>
@endif
@if(Auth::user()->can('view-inpatient-sheet'))
<div class="col-sm-2">
<button name="submit" value="maternity_summary" class="btn btn-success btn-sm btn-block" >{{ __('patient_episode.inpatient_sheet') }}</button>
</div>
@endif
@if(Auth::user()->can('view-birth-report'))
<div class="col-sm-2">
<button name="submit" value="birth_report" class="btn btn-sm btn-inverse btn-block" >NIRA {{ __('patient_episode.birth_report') }}</button>
</div>
@endif
<div class="col-sm-2"></div>
<div class="col-sm-2">
<div class="btn-group dropup m-r-10 col-sm-12">
<button aria-expanded="false" data-toggle="dropdown" class="btn btn-sm btn-info dropdown-toggle waves-effect waves-light btn-block" type="button">{{ __('patient_episode.theatre') }} <span class="caret"></span></button>
<ul role="menu" class="dropdown-menu">
@if(Auth::user()->can('create-anaesthetics'))
<li><button type="submit" name="submit" value="create_anaesthetics" class="btn btn-default btn-sm btn-link">{{ __('patient_episode.theatre_anaesthetics') }}</button></li>
@endif
@if(Auth::user()->can('view-anaesthetics-history'))
<li><button type="submit" name="submit" value="anaesthetics_history" class="btn btn-default btn-sm btn-link">{{ __('patient_episode.historical_anaesthetics') }}</button></li>
@endif
@if(Auth::user()->can('create-surgery'))
<li><button type="submit" name="submit" value="create_surgery" class="btn btn-default btn-sm btn-link">{{ __('patient_episode.theatre_surgery') }}</button></li>
@endif
@if(Auth::user()->can('view-surgery'))
<li><button type="submit" name="submit" value="surgery_index" class="btn btn-default btn-sm btn-link">{{ __('patient_episode.historical_surgeries') }}</button></li>
@endif
</ul>
</div>
</div>
</div>
</div>
<div id="menu2" style="display: none;">
<div class="row">
@if(Auth::user()->can('view-inpatient-sheet'))
<div class="col-sm-2">
<button type="submit" name="submit" class="btn btn-success btn-block btn-sm" value="inpatient-sheet-button">{{ __('patient_episode.inpatient_sheet') }}</button>
</div>
@endif
@if(Auth::user()->can('view-inpatient-billing'))
<div class="col-sm-2">
<button type="submit" name="submit" class="btn btn-success btn-block btn-sm" value="inpatient_billing">{{ __('patient_episode.inpatient_billing') }}</button>
</div>
@endif
@if(Auth::user()->can('issue-inpatient-attendant-pass'))
<div class="col-sm-2">
<button type="submit" name="submit" class="btn btn-default btn-block btn-sm" value="inpatient_attendant_pass">{{ __('patient_episode.inpatient_attendant_pass') }}</button>
</div>
@endif
@if(Auth::user()->can('view-patient-file'))
<div class="col-sm-2">
<button type="submit" name="submit" class="btn btn-primary btn-block btn-sm" value="patient_file">{{ __('patient_episode.episode_summary') }}</button>
</div>
@endif
<div class="col-sm-2"></div>
<div class="col-sm-2">
<div class="btn-group dropup m-r-10 col-sm-12">
<button aria-expanded="false" data-toggle="dropdown" class="btn btn-info dropdown-toggle waves-effect waves-light btn-sm btn-block " type="button">{{ __('patient_episode.theatre') }} <span class="caret"></span></button>
<ul role="menu" class="dropdown-menu">
<li><button type="submit" name="submit" value="create_anaesthetics" class="btn btn-default btn-sm btn-link">{{ __('patient_episode.theatre_anaesthetics') }}</button></li>
<li><button type="submit" name="submit" value="anaesthetics_history" class="btn btn-default btn-sm btn-link">{{ __('patient_episode.historical_anaesthetics') }}</button></li>
<li><button type="submit" name="submit" value="create_surgery" class="btn btn-default btn-sm btn-link">{{ __('patient_episode.theatre_surgery') }}</button></li>
<li><button type="submit" name="submit" value="surgery_index" class="btn btn-default btn-sm btn-link">{{ __('patient_episode.historical_surgeries') }}</button></li>
</ul>
</div>
</div>
</div>
</div>
<div id="theatre_menu" style="display: none;">
<div class="row">
@if(Auth::user()->can('create-anaesthetics'))
<div class="col-md-3">
<button type="submit" name="submit" class="btn btn-success btn-block" value="create_anaesthetics">{{ __('patient_episode.theatre_anaesthetics') }}</button>
</div>
@endif
@if(Auth::user()->can('view-anaesthetics-history'))
<div class="col-md-3">
<button type="submit" name="submit" class="btn btn-success btn-block" value="anaesthetics_history">{{ __('patient_episode.historical_anaesthetics') }}</button>
</div>
@endif
@if(Auth::user()->can('create-surgery'))
<div class="col-md-3">
<button type="submit" name="submit" class="btn btn-success btn-block" value="create_surgery">{{ __('patient_episode.theatre_surgery') }}</button>
</div>
@endif
@if(Auth::user()->can('view-surgery'))
<div class="col-md-3">
<button type="submit" name="submit" class="btn btn-success btn-block" value="surgery_index">{{ __('patient_episode.historical_surgeries') }}</button>
</div>
@endif
</div>
</div>
</div>
</div>
<div class="white-box" id="pic1" style="display: none;">
<div class="row">
<div class="col-sm-8"></div>
<div class="col-sm-4">
<img src="KH_photos/Picture3.jpg" style="max-height: 250px; margin: auto;" class="image-preview" alt="child" />
</div>
</div>
</div>
{{ Form::close() }}
<div class="modal hide fade" id="modal-age">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h3>{{ __('patient_episode.select_a_patient') }}</h3>
</div>
<div class="modal-body">
<p>
{{ __('patient_episode.select_patient_warning') }}
</p>
</div>
<div class="modal-footer">
<a href="#" class="btn btn-danger" data-dismiss="modal">{{ __('patient_episode.close') }}</a>
</div>
</div>
<div class="modal fade" id="internal_transfer_dialog" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">{{ __('patient_episode.internal_transfer') }}</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-12">
<div class="form-group">
{{ Form::label('current_clinic', __('patient_episode.current_clinic')) }}
{{ Form::hidden('current_clinic_id', 0, ['id' => 'current_clinic_id']) }}
{{ Form::hidden('current_triage_id', 0, ['id' => 'current_triage_id']) }}
{{ Form::hidden('current_episode_id', 0, ['id' => 'current_episode_id']) }}
{{ Form::text('current_clinic', '', ['class' => 'form-control compulsory', 'readonly', 'id' => 'current_clinic_transfer']) }}
</div>
<div class="form-group">
{{ Form::label('transfered_from_doctor', __('patient_episode.transfer_from_doctor')) }}
{{ Form::select('transfered_from_doctor', $users_array, '', ['class' => 'form-control transferedToDoctor', 'id' => 'transfer_from_doctor']) }}
</div>
<div class="form-group">
{{ Form::label('transfer_to', __('patient_episode.transfer_to')) }}
{{ Form::select('transfer_to', $clinics, null, ['class' => 'form-control compulsory', 'required', 'id' => 'transfer_to']) }}
</div>
<div class="form-group">
{{ Form::label('transfered_to_doctor', __('patient_episode.transfer_to_doctor')) }}
{{ Form::select('transfered_to_doctor', $users_array, '', ['class' => 'form-control transferedToDoctor', 'id' => 'transfer_to_doctor']) }}
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">{{ __('patient_episode.close') }}</button>
<button type="button" class="btn btn-success" id="submit_clinic_transfer" >{{ __('patient_episode.transfer_patient') }}</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="doctor_transfer_dialog" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">{{ __('patient_episode.transfer_doctor') }}</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-12">
<div class="form-group">
{{ Form::hidden('dt_episode_id', 0, ['id' => 'dt_episode_id']) }}
{{ Form::label('transfered_from_doctor', __('patient_episode.transfer_from_doctor')) }}
{{ Form::text('dt_from_doctor', '', ['class' => 'form-control', 'readonly', 'id' => 'dt_doctor_from']) }}
</div>
<div class="form-group">
{{ Form::label('transfered_to_doctor', __('patient_episode.transfer_to_doctor')) }}
@php $users_array = ['remove_from_doctor' => 'Remove from assigned doctor'] + $users_array; @endphp
{{ Form::select('dt_doctor_to', $users_array, '', ['class' => 'form-control transferedDtToDoctor', 'id' => 'dt_doctor_to']) }}
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">{{ __('patient_episode.close') }}</button>
<button type="button" class="btn btn-success" id="submit_doctor_transfer" >{{ __('patient_episode.transfer_patient') }}</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="ward_admission_episode" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">{{ __('layout.ward_admission') }}</h4>
</div>
<div class="modal-body">
{{ Form::open(['route' => 'patient_episodes.admit_patient_with_episode']) }}
{{ Form::hidden('patient_id', $patient->id, ['id' => 'patient_id']) }}
{{ Form::hidden('episode_admission_episode_id', 0, ['id' => 'episode_admission_episode_id']) }}
{{ Form::label('admission_ward_id', __('layout.select_ward')) }}
{{ Form::select('admission_ward_id', $wards, '', ['class' => 'form-control', 'required' => 'true']) }}
<br>
{{ Form::label('ward_admission_date', __('layout.admission_date')) }}
<input type="date" class="form-control" name="ward_admission_date" id="ward_admission_date" value="{{ date('Y-m-d') }}" required="true">
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-success btn-sm" onclick="return confirm('<?php echo __('layout.are_you_sure_admit'); ?>');">{{ __('layout.continue_ward_admission') }}</button>
{{ Form::close() }}
<button type="button" class="btn btn-danger btn-sm" data-dismiss="modal">{{ __('layout.close') }}</button>
</div>
</div>
</div>
</div>
@if(session()->has('consultation_not_paid'))
<div class="modal fade" id="unpaid_consultation_warning" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
</div>
<div class="modal-body">
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<h4 style="color: red">{{ __('patient_episode.patient_not_paid_consultation') }}</h4>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">{{ __('patient_episode.okay') }}</button>
</div>
</div>
</div>
</div>
@php session()->forget('consultation_not_paid'); @endphp
@endif
@endsection
@push('scripts')
<script src="{{ asset('js/streamline_plugins/jquery.session.js') }}"></script>
<script type="text/javascript">
$("#admit_patient").click(function () {
$.ajax({
url: '/inpatient/check_for_open_admissions/' + $('#patient_id').val(),
type: 'get',
success: function (response) {
if (response > 0) {
$("#modal_patient_already_admitted").modal("show");
} else {
let current_episode_id = $('input[name=episode_id]:checked').val();
$("#episode_admission_episode_id").val(current_episode_id);
$("#ward_admission_episode").modal("show");
}
},
error: function (response) {
}
});
});
$("#patient_file").click(function () {
let current_episode_id = $('input[name=episode_id]:checked').val();
let win = window.open('/patients/episode_summary/' + current_episode_id, '_blank');
if (win) {
win.focus();
} else {
alert("Please allow pop-ups for this system")
}
});
$("#internal_transfer").click(function () {
let current_episode_id = $('input[name=episode_id]:checked').val();
$.ajax({
type: "GET",
url: "/patient_episodes/internal_clinic_transfer/" + current_episode_id,
success: function (result) {
if (result != 0) {
let arr = result.split(',');
$('#current_clinic_transfer').val(arr[2]);
$('#current_clinic_id').val(arr[1]);
$('#current_triage_id').val(arr[0]);
$('#current_episode_id').val(current_episode_id);
$('#internal_transfer_dialog').modal('show');
} else {
alert("<?php echo __('patient_episode.triage_not_performed') ?>");
}
}
});
});
$("#submit_clinic_transfer").click(function () {
let transfer_clinic = $("#transfer_to").val();
let clinic = $("#current_clinic_id").val();
let triage_id = $("#current_triage_id").val();
let episode_id = $("#current_episode_id").val();
let patient_id = $('#patient_id').val();
let transfer_to_doctor = $('#transfer_to_doctor').val();
let transfer_from_doctor = $('#transfer_from_doctor').val();
if (transfer_clinic == 0) {
alert("<?php echo __('patient_episode.select_new_clinic') ?>");
} else {
$.ajax({
type: "POST",
url: "/patient_episodes/save_internal_clinic_transfer",
data: {new_clinic: transfer_clinic, old_clinic: clinic, triage_id: triage_id, episode_id: episode_id, patient_id: patient_id, transfer_from_doctor: transfer_from_doctor, transfer_to_doctor: transfer_to_doctor},
cache: false,
success: function (result) {
if (result == 1) {
alert("<?php echo __('patient_episode.patient_transfer_successful') ?>");
location.reload();
} else {
alert("<?php echo __('patient_episode.patient_transfer_failed') ?>");
}
}
});
}
});
$("#doctor_transfer").click(function (e) {
e.preventDefault();
let episode_id = $('input[name=episode_id]:checked').val();
$.ajax({
type: "GET",
url: "/patient_episodes/get_assigned_doctor/" + episode_id,
success: function (result) {
console.log(result);
if (result != 0) {
$("#dt_doctor_from").val(result);
$("#doctor_transfer_dialog").modal('show');
} else {
//alert("No assigned doctor");
$("#doctor_transfer_dialog").modal('show');
}
}
});
});
$("#submit_doctor_transfer").click(function () {
let episode_id = $('input[name=episode_id]:checked').val();
let dt_doctor_to = $('#dt_doctor_to').val();
console.log('episode_id = ' + episode_id);
console.log('doctor_id = ' + dt_doctor_to);
$.ajax({
type: "POST",
url: "/patient_episodes/save_doctor_transfer",
data: {episode_id: episode_id, dt_doctor_to: dt_doctor_to},
cache: false,
success: function (result) {
if (result == 1) {
alert("<?php echo __('patient_episode.patient_transfer_successful') ?>");
location.reload();
} else {
alert("<?php echo __('patient_episode.patient_transfer_failed') ?>");
}
}
});
});
function show(id) {
if (document.getElementById(id).style.display === 'none') {
document.getElementById(id).style.display = '';
}
}
function hide(id) {
document.getElementById(id).style.display = 'none';
}
$(document).ready(function () {
$(".to_hide").each(function () {
$(this).hide();
});
$("#edit").click(function () {
$(this).hide();
$("#submit_edit").show();
$(".to_show").each(function () {
$(this).hide();
});
$(".to_hide").each(function () {
$(this).show();
});
});
$("#close_modal").click(function () {
$("#submit_edit").hide();
$(".to_show").each(function () {
$(this).show();
});
$(".to_hide").each(function () {
$(this).hide();
});
$("#edit").show();
});
$('.transferedToDoctor').select2({
placeholder: "Select",
width: "100%",
dropdownParent: $('#internal_transfer_dialog')
});
$('.transferedDtToDoctor').select2({
placeholder: "Select",
width: "100%",
dropdownParent: $('#doctor_transfer_dialog')
});
$("#unpaid_consultation_warning").modal("show");
});
/*$("#consultation_button").click(function(e){
let episode_to_check_for_payment = $('input[name=episode_id]:checked').val();
let unpaid = false;
e.preventDefault();
$.ajax({
method: 'POST',
url: '/check_clinical_consultation_payment',
data: {'episode_id' : episode_to_check_for_payment},
success: function(response){
if (response == "paid") {
console.log("man of valor with armour");
$("#episodesForm").submit();
console.log("submit the form please");
} else {
console.log("regular man");
$("#unpaid_consultation_warning").modal("show");
}
},
error:function(error){
console.log(error);
}
});
});*/
</script>
@endpush
@push('styles')
<style type="text/css">
.btn-default.btn-sm.btn-link{
width: 100%;
}
</style>
@endpush
@@ -0,0 +1,804 @@
@push('styles')
<style>
.episode-menu li {
display: inline-block;
}
.highlight {
font-weight: bold;
}
.modal-dialog {
position: absolute;
top: 40%;
left: 50%;
transform: translate(-50%, -50%) !important;
}
</style>
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
@endpush
<div class="row">
<div class="col-sm-9">
<div class="" style='height: 80px;background-color: #f7f7f9; padding-top: 10px; padding-left: 10px;'>
<ul class='episode-menu' style="padding-left: 0px;">
<div class="row">
<div class="col-sm-2">
<li>
<button type="button" class="btn btn-success btn-sm" data-toggle="modal" data-target="#demographicsModal">{{ __('layout.demographics') }}</button>
</li>
</div>
<div class="col-sm-3">
<div class="form-group">
<select class="form-control" name="new_episode_option" id="new_episode_options">
<option value="" selected disabled>{{ __('layout.create_new_episode') }}</option>
@if (Auth::user()->can('create-patient-episode'))
<option value="1">{{ __('layout.new_episode') }}</option>
@endif
@if (Auth::user()->can('create-patient-episode-with-clinic'))
<option value="2"> {{ __('layout.new_episode_with_clinic') }}</option>
@endif
@if (Auth::user()->can('create-patient-episode-with-doctor'))
<option value="3">{{ __('layout.new_episode_with_doctor') }}</option>
@endif
@if (Auth::user()->can('create-patient-episode-with-doctor-and-clinic'))
<option value="4"> {{ __('layout.new_episode_with_doctor_and_clinic') }}</option>
@endif
@if (Auth::user()->can('create-patient-episode-with-admission'))
<option value="5"> {{ __('layout.new_episode_with_admission') }}</option>
@endif
@if (Auth::user()->can('create-patient-episode-with-self-lab-request'))
<option value="6"> {{ __('layout.new_episode_with_inv_self_request') }}</option>
@endif
</select>
</div>
<div class="modal fade" id="newEpisodeModal" tabindex="-1" role="dialog" aria-labelledby="modalNewEpisodeModelLabel1">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="modalNewEpisodeModelLabel1">{{ __('patient_episode.new_episode_option') }}</h4>
</div>
<div class="modal-body">
{{ Form::open(['route' => 'patient_episodes.create_special_clinic_episode']) }}
{{ Form::hidden('patient_id', $patient->id) }}
{{ Form::label('new_episode_option', __('patient_episode.new_episode_option')) }}
{{ Form::select('new_episode_option', [], '', ['class' => 'form-control', 'required' => 'true'])}}
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-success btn-sm" onclick="return confirm('<?php echo __('layout.are_you_sure_clinic'); ?>');">{{ __('layout.continue_clinic_allocation') }}</button>
{{ Form::close() }}
<button type="button" class="btn btn-danger btn-sm" data-dismiss="modal">{{ __('layout.close') }}</button>
</div>
</div>
</div>
</div>
@if( Auth::user()->can('create-patient-episode'))
<li>
<!-- <button type="submit" class="btn btn-success btn-sm show-episode-modal" data-backdrop="static" data-keyboard="false" data-toggle="modal" data-target="#episodeModal">{{ __('layout.new_episode') }}</button> -->
</li>
@endif
@if( Auth::user()->can('create-patient-episode-with-clinic'))
<li>
<!-- <a class="btn btn-success btn-sm" data-toggle="modal" data-target="#newEpisodeAndClinicModal">{{ __('layout.new_episode_clinic') }}</a> -->
<div class="modal fade" id="newEpisodeAndClinicModal" tabindex="-1" role="dialog" aria-labelledby="modalSpecialLabel1">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="modalSpecialLabel1">{{ __('layout.clinic_allocation') }}</h4>
</div>
<div class="modal-body">
{{ Form::open(['route' => 'patient_episodes.create_special_clinic_episode']) }}
{{ Form::hidden('patient_id', $patient->id) }}
{{ Form::label('special_clinic_id', __('layout.select_clinic')) }}
{{ Form::select('special_clinic_id', $special_clinics, '', ['class' => 'form-control', 'required' => 'true'])}}
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-success btn-sm" onclick="return confirm('<?php echo __('layout.are_you_sure_clinic'); ?>');">{{ __('layout.continue_clinic_allocation') }}</button>
{{ Form::close() }}
<button type="button" class="btn btn-danger btn-sm" data-dismiss="modal">{{ __('layout.close') }}</button>
</div>
</div>
</div>
</div>
</li>
@endif
@if( Auth::user()->can('create-patient-episode-with-doctor-and-clinic'))
<li>
<!-- <a class="btn btn-success btn-sm" data-toggle="modal" data-target="#episodeWithDoctorAndClinicModal">{{ __('patient_episode.new_episode_with_doctor_and_clinic') }}</a> -->
<div class="modal fade" id="episodeWithDoctorAndClinicModal" tabindex="-1" role="dialog" aria-labelledby="episodeWithDoctorAndClinicLabel1">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="episodeWithDoctorAndClinicLabel1">{{ __('patient_episode.doctor_and_clinic_allocation') }}</h4>
</div>
<div class="modal-body">
{{ Form::open(['route' => 'patient_episodes.create_episode_with_doctor_and_clinic']) }}
{{ Form::hidden('patient_id', $patient->id) }}
<div class="form-group">
{{ Form::label('special_clinic_id', __('layout.select_clinic')) }}
{{ Form::select('special_clinic_id', $special_clinics, '', ['class' => 'form-control', 'required' => 'true'])}}
</div>
<div class="form-group">
{{ Form::label('allocated_services_id_with_doctor_id', __('patient_episode.doctor_allocation')) }}
{{ Form::select('allocated_services_id_with_doctor_id', $users_array, '', ['class' => 'form-control doctorWithClinicDoctorDropDown', 'required' => 'true'])}}
</div>
@if(is_patient_category_pay_later($patient->category_id))
<div class="form-group">
{{ Form::label('claim_number', __('patient_episode.claim_number')) }}
{{ Form::text('claim_number', '', ['class' => 'form-control', 'required' => 'true', 'id'=>'claim_number'])}}
</div>
@endif
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-success btn-sm" onclick="return confirm('<?php echo __('patient_episode.are_you_sure_doctor_and_clinic'); ?>');">{{ __('patient_episode.continue_allocation') }}</button>
{{ Form::close() }}
<button type="button" class="btn btn-danger btn-sm" data-dismiss="modal">{{ __('layout.close') }}</button>
</div>
</div>
</div>
</div>
</li>
@endif
@if( Auth::user()->can('create-patient-episode-with-doctor'))
<li>
<!-- <a class="btn btn-success btn-sm" data-toggle="modal" data-target="#episodeWithDoctorModal">{{ __('patient_episode.new_episode_with_doctor') }}</a> -->
<div class="modal fade" id="episodeWithDoctorModal" tabindex="-1" role="dialog" aria-labelledby="episodeWithDoctorLabel1">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="episodeWithDoctorLabel1">{{ __('patient_episode.doctor_allocation') }}</h4>
</div>
<div class="modal-body">
{{ Form::open(['route' => 'patient_episodes.create_episode_with_doctor']) }}
{{ Form::hidden('patient_id', $patient->id) }}
{{ Form::label('allocated_services_id_with_doctor_id', __('patient_episode.doctor_allocation')) }}
{{ Form::select('allocated_services_id_with_doctor_id', $users_array, '', ['class' => 'form-control doctorDropDown', 'required' => 'true'])}}
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-success btn-sm" onclick="return confirm('<?php echo __('patient_episode.are_you_sure_doctor'); ?>');">{{ __('patient_episode.continue_doctor_allocation') }}</button>
{{ Form::close() }}
<button type="button" class="btn btn-danger btn-sm" data-dismiss="modal">{{ __('layout.close') }}</button>
</div>
</div>
</div>
</div>
</li>
@endif
@if( Auth::user()->can('create-patient-episode-with-self-lab-request'))
<li>
<div class="modal fade" id="episodeWithSelfLabRequestModal" tabindex="-1" role="dialog" aria-labelledby="episodeWithSelfLabRequestLabel1">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="episodeWithSelfLabRequestLabel1">{{ __('patient_episode.new_episode_with_self_lab_request') }}</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-sm-9" style="margin-top: 5px;">{{ __('layout.are_you_sure_inv_self_request') }}</div>
<div class="col-sm-3">
{{ Form::open(['route' => 'patient_episodes.create_episode_with_lab_self_request']) }}
{{ Form::hidden('patient_id', $patient->id) }}
<button type="submit" class="btn btn-success btn-sm" name="createNewEpisode">{{ __('layout.yes') }}</button>
<button type="button" class="btn btn-default" data-dismiss="modal">{{ __('layout.cancel') }}</button>
{{ Form::close() }}
</div>
</div>
</div>
</div>
</div>
</div>
</li>
@endif
</div>
<div class="col-sm-4">
<li>
<a class="btn btn-info btn-small" onclick="return popitup('https://primaryreporting.who-umc.org/Reporting/Reporter?OrganizationID=UG')">
{{ __('layout.sadr_report') }}
</a>
</li>
</div>
<div class="col-sm-3">
@if($patient->gender == 2)
<li>
@if( Auth::user()->can('create-maternity-admission'))
<a class="btn btn-default" id="maternityAdmissionBtn"><i class="fa fa-plus-square"></i> {{ __('layout.maternity_admission') }}</a>
@endif
@if(Module::has('Maternity') && Module::isEnabled('Maternity'))
<!-- materninty modal -->
<div class="modal fade" id="maternityModal" tabindex="-1" role="dialog" aria-labelledby="modalMaternityLabel1">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="modalMaternityLabel1">{{ __('layout.date_of_maternity_admission') }}</h4>
</div>
<div class="modal-body">
{{ Form::open(['route' => 'maternity.create_episode']) }}
{{ Form::hidden('patient_id', $patient->id) }}
<input type="date" class="form-control" name="maternity_date" id="maternity_date_field" value="{{ date('Y-m-d') }}">
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-success btn-sm" onclick="return confirm('<?php echo __('layout.are_you_sure_admit_maternity'); ?>');">{{ __('layout.continue_maternity_admission') }}</button>
{{ Form::close() }}
<button type="button" class="btn btn-danger btn-sm" data-dismiss="modal">{{ __('layout.close') }}</button>
</div>
</div>
</div>
</div>
<!-- end maternity modal -->
@endif
</li>
@endif
<li>
@if( Auth::user()->can('create-ward-admission'))
<!-- <a class="btn btn-success btn-sm" data-toggle="modal" data-target="#wardAdmissionModal">{{ __('layout.ward_admission') }}</a> -->
@endif
<div class="modal fade" id="wardAdmissionModal" tabindex="-1" role="dialog" aria-labelledby="modalWardAdmissionLabel1">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="modalWardAdmissionLabel1">{{ __('layout.ward_admission') }}</h4>
</div>
<div class="modal-body">
{{ Form::open(['route' => 'patient_episodes.create_episode_with_ward']) }}
{{ Form::hidden('patient_id', $patient->id, ['id' => 'patient_id']) }}
{{ Form::label('admission_ward_id', __('layout.select_ward')) }}
{{ Form::select('admission_ward_id', $wards, '', ['class' => 'form-control', 'required' => 'true']) }}
<br>
{{ Form::label('ward_admission_date', __('layout.admission_date')) }}
<input type="date" class="form-control" name="ward_admission_date" id="ward_admission_date" value="{{ date('Y-m-d') }}" required="true">
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-success btn-sm" onclick="return confirm('<?php echo __('layout.are_you_sure_admit'); ?>');">{{ __('layout.continue_ward_admission') }}</button>
{{ Form::close() }}
<button type="button" class="btn btn-danger btn-sm" data-dismiss="modal">{{ __('layout.close') }}</button>
</div>
</div>
</div>
</div>
</li>
</div>
</div>
</ul>
</div>
</div>
<div class="col-sm-3 pull-right">
<div class="white-box" style='height: 80px; padding-top: 5px;'>
<div class="row">
<a data-toggle="collapse" data-target="#collapseDiv" class="white-link">
<b>{{ __('layout.patient_documents') }} </b><small style="color: blue;">({{ $documents?count($documents):""}})</small>
<span class="fa fa-angle-down">
</span>
</a>
<a href="#" style="color: #003399" class="details pull-right">
</a>
</div>
<div id="collapseDiv" class="">
<div class="row">
<div class="col-sm-8">
@if(!is_null($documents))
<ul>
<!-- @foreach($documents as $document)
<li><a href="/patient_documents/{{$document->id}}" target="_blank">{{ $document->title }}</a></li>
@endforeach -->
<li><div class="label label-danger">{{ count($documents) }} {{ __('layout.documents_attached') }}</div></li>
<small><a href="#" onclick="go()" style="font: blue; cursor: pointer; font-weight: bold;"> {{ __('layout.view_all') }}</a></small>
<ul>
@endif
</div>
<div class="col-sm-4">
<!-- <a class="btn btn-warning btn-sm" href="">Add New</a> -->
</div>
</div>
</div>
</div>
</div>
<!-- patient appointments not attached to any episode -->
@php
$un_fullfilled_appointments = un_fullfilled_patient_appointments($patient->id);
@endphp
@if(count($un_fullfilled_appointments) > 0)
<div class="col-sm-12">
<div class="white-box" style="padding: 10px;">
<strong>{{ __('layout.patient_appointments') }}</strong>
<div class="table-responsive">
<table class="table color-bordered-table warning-bordered-table">
<thead>
<tr>
<th>{{ __('layout.appointment_date') }}</th>
<th>{{ __('layout.appointment_time') }}</th>
<th>{{ __('layout.episode_started_on') }}</th>
<th>{{ __('layout.clinic') }}</th>
<th>{{ __('layout.in_charge') }}</th>
<th>{{ __('layout.comments') }}</th>
<th style="width: 5%"></th>
</tr>
</thead>
<tbody>
@foreach($un_fullfilled_appointments as $appointment)
<tr>
<td>
{{ is_null($appointment->appointment_date) ? '' : streamline_date($appointment->appointment_date) }}
</td>
<td>
{{ $appointment->appointment_time }}
</td>
<td>
{{ $appointment->episode_id == 0 ? "" : streamline_date_time(get_name($appointment->episode_id, 'id', 'created_at', 'patient_episodes')) }}
</td>
<td>
{{ get_name($appointment->clinic_allocation, 'id', 'name', 'clinics') }}
</td>
<td>
{{ get_full_name($appointment->incharge_id, 'id', 'first_name', 'last_name', 'users') != "ALL STAFF" ? get_full_name($appointment->incharge_id, 'id', 'first_name', 'last_name', 'users') : "N/A" }}
</td>
<td>
{{ $appointment->comments }}
</td>
<td class="text-center">
<a class="btn btn-success btn-rounded btn-xs" onclick="displayAppointmentActions({{ $appointment->patient_id}},{{ $appointment->id}})">{{ __('layout.appointment_actions') }}</a>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
@endif
</div>
@php $dob = new Carbon\Carbon($patient->date_of_birth); @endphp
<div class="modal fade" id="demographicsModal" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="exampleModalLabel1">{{ __('layout.patient_details') }}</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-sm-6">
<table class="table table-bordered">
<tbody>
<tr>
<th class="highlight">{{ __('layout.patient_number') }}</th>
<td>{{ $patient->number }}</td>
</tr>
<tr>
<th class="highlight">{{ __('layout.patient_names') }}</th>
<td>{{ $patient->first_name }} {{ $patient->last_name }}</td>
</tr>
<tr>
<th class="highlight">{{ __('layout.gender') }}</th>
<td>{{ $patient->gender == 1 ? __('layout.male') : __('layout.female') }}</td>
</tr>
<tr>
<th class="highlight">{{ __('layout.date_of_birth') }}</th>
<td>{{ streamline_date($patient->date_of_birth) }}</td>
</tr>
<tr>
<th class="highlight">{{ __('layout.age') }}</th>
<td>{{ $dob->diffInYears(Carbon\Carbon::now()) }} {{ __('layout.years') }}</td>
</tr>
<tr>
<th class="highlight">{{ __('layout.residence') }}</th>
<td>
{{ patient_residence($patient->id) }}
</td>
</tr>
<tr>
<th class="highlight">{{ __('layout.marital_status') }}</th>
<td>
{{ isset($marital_statuses[$patient->marital_status]) ? $marital_statuses[$patient->marital_status] : "N/A" }}
</td>
</tr>
<tr>
<th class="highlight">National ID</th>
<td>
{{ strtoupper($patient->national_id) }}
</td>
</tr>
@if (mother_of_patient($patient->id))
@php
$mother_id = mother_of_patient($patient->id);
@endphp
<tr>
<th class="highlight"><font color="black">{{ __('patients.mother_name') }}:</font></th>
<td>
<a href="/patients/{{ $mother_id }}">
{{ get_full_name($mother_id, "id", "first_name", "last_name", "patients") }} ({{ get_name($mother_id, "id", "number", "patients") }})
</a>
</td>
</tr>
@endif
@if (children_of_patient($patient->id))
@php
$children_ids_array = children_of_patient($patient->id);
@endphp
<tr>
<th class="highlight"><font color="black">{{ __('patients.children') }}:</font></th>
<td>
<ol>
@for ($i = 0; $i < count($children_ids_array); $i++)
<li>
<a href="/patients/{{ $children_ids_array[$i] }}">
{{ get_full_name($children_ids_array[$i], "id", "first_name", "last_name", "patients") }} ({{ get_name($children_ids_array[$i], "id", "number", "patients") }})
</a>
</li>
@endfor
</ol>
</td>
</tr>
@endif
</tbody>
</table>
</div>
<div class="col-sm-6">
<table class="table table-bordered">
<tbody>
<tr>
<th class="highlight">{{ __('layout.next_of_kin') }}</th>
<td>{{ $patient->next_of_kin }}</td>
</tr>
<tr>
<th class="highlight">{{ __('layout.relationship') }}</th>
<td>
{{ isset($relationships[$patient->next_of_kin_relationship]) ? $relationships[$patient->next_of_kin_relationship] : "N/A" }}
</td>
</tr>
<tr>
<th class="highlight">{{ __('layout.mobile_number') }}</th>
<td>{{ $patient->phone }}</td>
</tr>
<tr>
<th class="highlight">{{ __('layout.phone_name') }}</th>
<td>{{ $patient->phone_owner }}</td>
</tr>
<tr>
<th class="highlight">{{ __('layout.insurance_status') }}</th>
<td>
@if($patient->insurance_status == 1)
{{ __('layout.insured') }}
@else
{{ __('layout.not_insured') }}
@endif
</td>
</tr>
<tr>
<th class="highlight">{{ __('layout.occupation') }}</th>
<td>
{{ isset($occupations[$patient->occupation_id]) ? $occupations[$patient->occupation_id] : "N/A" }}
</td>
</tr>
<tr>
<th class="highlight">{{ __('layout.patient_category') }}</th>
<td>
{{ isset($patient_categories[$patient->category_id]) ? $patient_categories[$patient->category_id] : "N/A" }}
</td>
</tr>
<tr>
<th class="highlight">{{ __('layout.registered_by') }}</th>
<td>{{ get_full_name($patient->created_by, 'id', 'first_name', 'last_name', 'users') }}</td>
</tr>
<tr>
<th class="highlight">{{ __('layout.registered_on') }}</th>
<td>
{{ streamline_date($patient->created_at) }}
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">{{ __('layout.close') }}</button>
<button type="button" class="btn btn-primary" id="edit_patient" onclick="window.location.href='/patients/{{ $patient->id }}/edit'">{{ __('layout.edit_patient') }}</button>
</div>
</div>
</div>
</div>
<!-- modal that pops up when a new episode is clicked -->
@if( Auth::user()->can('create-patient-episode'))
<div class="modal fade" id="episodeModal" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-body">
<div class="row">
<div class="col-sm-9" style="margin-top: 5px;">{{ __('layout.begin_episode_for_patient') }}</div>
<div class="col-sm-3">
{{ Form::open(['route' => 'patient_episodes.create_episode', 'onsubmit' => 'createNewEpisode.disabled = true; return true;']) }}
{{ Form::hidden('patient_id', $patient->id) }}
<button type="submit" class="btn btn-success btn-sm" name="createNewEpisode">{{ __('layout.yes') }}</button>
<button type="button" class="btn btn-default" data-dismiss="modal">{{ __('layout.cancel') }}</button>
{{ Form::close() }}
</div>
</div>
</div>
</div>
</div>
</div>
@endif
<!-- modal that pops up when its an action on an appointment -->
<div class="modal" id="modal_select_actions" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-lg modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title">{{ __('layout.select_actions') }}</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-3">
<button class="btn btn-success btn-rounded" data-toggle="modal" id="startAppWithClinicBtn">{{ __('layout.start_appointment_with_clinic') }}</button>
</div>
<div class="col-md-3">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="btn btn-success btn-rounded" onclick="displayActivationModel()">{{ __('layout.start_appointment') }}</a>
</div>
<div class="col-md-3">
<a class="btn btn-warning btn-rounded" onclick="reschedule_appointment()">{{ __('layout.reschedule_appointment') }}</a>
</div>
<div class="col-md-3">
<a class="btn btn-danger btn-rounded" onclick="cancel_appointment()">{{ __('layout.cancel_appointment') }}</a>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal" id="modal_patient_already_admitted" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-lg modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title">{{ __('layout.patient_alert') }}</h4>
</div>
<div class="modal-body">
<h5>{{ __('layout.pat_still_admitted_discharge') }}</h5>
<div class="row">
<div class="col-md-6">
<a class="btn btn-info btn-rounded" data-dismiss="modal">{{ __('layout.cancel') }}</a>
</div>
<div class="col-md-6">
<a class="btn btn-info btn-rounded pull-right" id="discharge_patient_button">{{ __('layout.discharge_pat_continue') }}</a>&nbsp;&nbsp;&nbsp;
</div>
</div>
</div>
</div>
</div>
</div>
<!-- start an appointment with a clinic and a doctor option -->
<div class="modal fade" id="startAppointmentWithClinicModal" tabindex="-1" role="dialog" aria-labelledby="appointmentWithDoctorAndClinicLabel1">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="appointmentWithDoctorAndClinicLabel1">{{ __('patient_episode.doctor_and_clinic_allocation') }}</h4>
</div>
<div class="modal-body">
{{ Form::open(['route' => 'patient_episodes.start_appointment_with_doctor_and_clinic']) }}
{{ Form::hidden('patient_id', $patient->id) }}
{{ Form::hidden('selected_appointment_id', 0, ['id' => 'selected_appointment_id']) }}
<div class="form-group">
{{ Form::label('special_clinic_id', __('layout.select_clinic')) }}
{{ Form::select('special_clinic_id', $special_clinics, '', ['class' => 'form-control', 'required' => 'true'])}}
</div>
<div class="form-group">
{{ Form::label('allocated_services_id_with_doctor_id', __('patient_episode.doctor_allocation')) }}
{{ Form::select('allocated_services_id_with_doctor_id', $users_array, '', ['class' => 'form-control appWithClinicDoctorDropDown'])}}
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-success btn-sm" onclick="return confirm('<?php echo __('patient_episode.are_you_sure_doctor_and_clinic'); ?>');">{{ __('patient_episode.continue_allocation') }}</button>
{{ Form::close() }}
<button type="button" class="btn btn-danger btn-sm" data-dismiss="modal">{{ __('layout.close') }}</button>
</div>
</div>
</div>
</div>
@push('scripts')
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script type="text/javascript">
$("#new_episode_options").change(function(){
var clicked_episode_option = $(this).val();
if (clicked_episode_option == 1) {
$("#episodeModal").modal("show");
} else if(clicked_episode_option == 2){
$("#newEpisodeAndClinicModal").modal("show");
} else if(clicked_episode_option == 3){
$("#episodeWithDoctorModal").modal("show");
} else if(clicked_episode_option == 4){
$("#episodeWithDoctorAndClinicModal").modal("show");
} else if(clicked_episode_option == 5){
$.ajax({
url: '/inpatient/check_for_open_admissions/' + $('#patient_id').val(),
type: 'get',
success: function (response) {
if (response > 0) {
$("#modal_patient_already_admitted").modal("show");
} else {
$("#wardAdmissionModal").modal("show");
}
},
error: function (response) {
}
});
} else if(clicked_episode_option == 6){
$("#episodeWithSelfLabRequestModal").modal("show");
}
});
$("#discharge_patient_button").click(function (){
$.ajax({
url: '/inpatient/discharge_patient_past_admissions/' + $('#patient_id').val(),
type: 'get',
success: function (response) {
$("#modal_patient_already_admitted").modal("hide");
$("#wardAdmissionModal").modal("show");
},
error: function (response) {
}
});
});
$("#maternityAdmissionBtn").click(function (e){
e.preventDefault();
$.ajax({
url: '/inpatient/check_for_open_admissions/' + $('#patient_id').val(),
type: 'get',
success: function (response) {
if (response > 0) {
$("#modal_patient_already_admitted").modal("show");
} else {
$("#maternityModal").modal("show");
}
},
error: function (response) {
}
});
});
$('.doctorDropDown').select2({
placeholder: "Select",
width: "100%",
dropdownParent: $('#episodeWithDoctorModal')
});
$('.doctorWithClinicDoctorDropDown').select2({
placeholder: "Select",
width: "100%",
dropdownParent: $('#episodeWithDoctorAndClinicModal')
});
$('#startAppWithClinicBtn').click(function(e) {
$('#modal_select_actions').modal('hide');
$('#selected_appointment_id').val(appointmentId);
$('#startAppointmentWithClinicModal').modal('show');
});
$('.appWithClinicDoctorDropDown').select2({
placeholder: "Select",
width: "100%",
dropdownParent: $('#startAppointmentWithClinicModal')
});
function popitup(url) {
newwindow = window.open(url, 'name', 'height=700,width=850, top=50, left=300');
if (window.focus) {
newwindow.focus();
}
return false;
}
function go(url) {
event.preventDefault();
let options = document.getElementsByName('episode_id');
let episodeId = 0;
if (options) {
for (let i = 0; i < options.length; i++) {
if (options[i].checked){
episodeId = options[i].value;
}
}
}
$.ajax({
url: 'set_episode_id/'+episodeId+'/patient_documents',
type: 'get',
success: function(response){
window.location.href = '/patient_documents';
},
error: function(response){
}
});
}
/* stuff for patient appointments */
let selectedPatientId = 0;
let appointmentId = 0;
function reschedule_appointment() {
if (confirm("<?php echo __('layout.reschedule_appointment_question') ?>")) {
window.location.href = "/patients/reschedule_appointment/" + appointmentId;
}
}
function cancel_appointment() {
if (confirm("<?php echo __('layout.cancel_appointment_cancel') ?>")){
$.ajax({
method: 'GET',
url: '/patients/cancel_patient_appointment/' + appointmentId,
success: function(response){
if(response == 1) {
alert("<?php echo __('layout.appointment_cancelled') ?>");
$("#modal_select_actions").modal("hide");
fetch_patients();
} else {
alert("<?php echo __('layout.cancel_appointment_failed') ?>");
}
}
});
}
}
function displayAppointmentActions(patientId, appointment_id) {
selectedPatientId = patientId;
appointmentId = appointment_id;
$("#modal_select_actions").modal("show");
}
function displayActivationModel(){
window.location.href = "/patients/complete_appointment/" + appointmentId;
}
</script>
@endpush
@push('scripts')
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script type="text/javascript">
$('#new_episode_options').select2();
</script>
@endpush
@@ -0,0 +1,277 @@
@extends('layouts.main')
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('patient_episode.merge_episodes') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('patients.dashboard') }}</a></li>
<li><a href="{{ route('patients.index') }}">{{ __('patients.patients') }}</a></li>
<li class="active">{{ __('patient_episode.merge_episodes') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="white-box">
<div class="row">
<div class="col-sm-12">
<h2><strong style="color: red">{{ __('patient_episode.episode_records') }}</strong><small> ({{ __('patient_episode.select_records_merge') }}) &nbsp;&nbsp;</small><a class="btn btn-info merge-record" onclick="mergeRecord()" style="display: none;" id="mergeBtn">{{ __('patient_episode.merge_episodes') }}</a></h2>
</div>
</div>
<hr style="background-color: black;">
@foreach($episodes as $episode)
<div class="row">
<div class="col-sm-4">
<table class="table-bordered table-condensed table-striped col-sm-12">
<tbody>
<tr>
<th><font color="black">{{ __('patient_episode.episode_date') }}</font></th>
<td>
<input type="checkbox" name="checked_episode_id[]" value="{{ $episode->id}}" class="checkbox_control">
<a href="#" style="color: #0099CC">{{ streamline_date_time($episode->created_at) }}
</a>
<br>
<small>{{ __('patient_episode.started_by') }}: <font style="color: blue">{{ get_full_name($episode->created_by, "id", "first_name", "last_name", "users") }}</font></small>
@if(check_if_episode_is_a_followup($episode->id))
@php
$parent_episode = \Streamline\Models\PatientEpisode::find($episode->parent_episode_id);
@endphp
<small style="color: green"><br>({{ __('patient_episode.review_from') }}: {{ streamline_date($parent_episode->created_at) }})</small>
@endif
</td>
</tr>
<tr>
<th><font color="black">{{ __('patient_episode.clinic') }}</font></th>
<td>
@if( Auth::user()->can('view-patient-episode-clinic-from-patient-home'))
{{ get_name($episode->clinic_id, "id", "name", "clinics") }}
@endif
</td>
</tr>
</tbody>
</table>
</div>
<div class="col-sm-4">
<table class="table-bordered table-condensed table-striped col-sm-12">
<tbody>
<tr>
<th><font color="black">{{ __('patient_episode.primary_diagnosis') }}</font></th>
<td>
@if( Auth::user()->can('view-patient-episode-primary-diagnoses'))
{{ get_name(get_name($episode->consultation_id, "id", "primary_diagnosis", "consultations"), "id", "name", "diagnoses") }}
@endif
</td>
</tr>
<tr>
@php
$other_diagnoses_ids = '';
$other_diagnoses = '';
$triage_and_consultation_comments = '';
$triage_comment = get_name($episode->triage_id, "id", "comments", "triage");
if(!is_null($episode->consultation_id)){
$other_diagnoses_ids = trim(get_name($episode->consultation_id, 'id', 'other_diagnoses', 'consultations'));
$consultation_comment = get_name($episode->consultation_id, "id", "comments", "consultations");
$triage_and_consultation_comments = '<b>Triage: </b>'.$triage_comment.' '.'<br><b>Consultation: </b>'.$consultation_comment;
}
$other_diagnoses_explode = ($other_diagnoses_ids != 'N/A' && $other_diagnoses_ids != '') ? unserialize($other_diagnoses_ids) : [];
for($s = 0; $s < count($other_diagnoses_explode); $s++){
$other_diagnoses .= isset($diagnoses[$other_diagnoses_explode[$s]]) ? $diagnoses[$other_diagnoses_explode[$s]] . ", " : '';
}
@endphp
<th><font color="black">{{ __('patient_episode.other_diagnoses') }}</font></th>
<td class="hidden-phone">
@if( Auth::user()->can('view-patient-episode-other-diagnoses'))
{!! read_more($other_diagnoses, 'other_diagnoses_short' . $episode->id, 'other_diagnoses_long' . $episode->id) !!}
<div id="other_diagnoses_long{{ $episode->id }}" style="display: none;">
{!! $other_diagnoses !!}<br/>
<a class="read_more" style="color : #0099CC;" onclick= "hide('other_diagnoses_long{{ $episode->id }}');show('other_diagnoses_short{{ $episode->id }}');">{{ __('episode.read_less') }}</a>
</div>
@endif
</td>
</tr>
</tbody>
</table>
</div>
<div class="col-sm-3">
<table class="table-bordered table-condensed table-striped col-sm-12">
<tbody>
<tr>
<th><font color="black">{{ __('patient_episode.consultation_done_by') }}</font></th>
<td class="hidden-phone">
@php
$consultation_done_by = get_doctor_who_has_done_episode_consultation($episode->patient_id, $episode->id);
@endphp
@if(!is_null($consultation_done_by))
{{ get_full_name($consultation_done_by, "id", "first_name", "last_name", "users") }}
@endif
@if($episode->episode_type == 1)
<span>{{ __('patient_flow_monitoring.lab_self_request') }}</span>
@endif
</td>
</tr>
<tr>
<th><font color="black">{{ __('patient_episode.comments') }}</font></th>
<td class="hidden-phone">
{!! read_more($triage_and_consultation_comments, 'short_comment' . $episode->id, 'long_comment' . $episode->id) !!}
<div id="long_comment{{ $episode->id }}" style="display: none;">
{!! $triage_and_consultation_comments !!}<br/>
<a class="read_more" style="color : #0099CC;" onclick= "hide('long_comment{{ $episode->id }}');show('short_comment{{ $episode->id }}');">{{ __('patient_episode.read_less') }}</a>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div class="col-sm-1">
</div>
</div>
<hr style="background-color: black;">
@endforeach
<div class="row">
<a class="btn btn-info merge-record" onclick="mergeRecord()" style="display: none;" id="mergeBtnOther">{{ __('patient_episode.merge_episodes') }}</a>
</div>
</div>
</div>
</div>
<!-- merge dialog box to allow user select master field value -->
<div class="modal fade" id="selectMasterDialog" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg" role="document" style="margin-top: 15%;">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="wardDispensationModalLabel1">{{ __('patient_episode.select_information_to_keep') }} </h4>
</div>
<div class="modal-body">
{{ Form::open(['route' => 'patient_episodes.complete_merge']) }}
<div class="row" id="mergingModalDiv">
<div class="col-sm-8" style="padding-right: 1px;">
<div class="table-responsive" id="modal_table_one"></div>
</div>
<div class="col-sm-4" style="padding-left: 1px;">
<div class="table-responsive" id="modal_table_two"></div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-success" id="completeMerge">{{ __('patient_episode.complete') }}</button>
<button type="button" class="btn btn-default" data-dismiss="modal">{{ __('layout.close') }}</button>
{{ Form::close() }}
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script type="text/javascript">
function mergeRecord() {
//console.log();
var selectedEpisodesArray = [];
$('input[name="checked_episode_id[]"]:checked').each(function () {
var checkedEp = $(this).val();
console.log("episodes ids ===" + checkedEp);
selectedEpisodesArray.push(checkedEp);
});
var episodeOne = selectedEpisodesArray[0];
var episodeTwo = selectedEpisodesArray[1];
$.ajax({
method: 'POST',
url: '/display_original_and_duplicate_episodes',
data: {'episode_id_one': episodeOne, 'episode_id_two': episodeTwo},
success: function(response){
let responseArray = JSON.parse(response);
$("#modal_table_one").html(responseArray["html_one"]);
$("#modal_table_two").html(responseArray["html_two"]);
$("#selectMasterDialog").modal("show");
}
});
}
function show(id) {
if (document.getElementById(id).style.display === 'none') {
document.getElementById(id).style.display = '';
}
}
function hide(id) {
document.getElementById(id).style.display = 'none';
}
$('input[name="checked_episode_id[]"]').click(function () {
//var pass = parseInt($('input[name="checked_episode_id"]:checked').val(), 10) //1,2,3
var checkedEpisodes = $('input[name="checked_episode_id[]"]:checked').length;
console.log("checked episodes ===" + checkedEpisodes);
if (checkedEpisodes == 2) {
//$('input[name="checked_episode_id[]"]:checked').not(':checked').prop('disabled', true);
$('input.checkbox_control:not(:checked)').attr('disabled', 'disabled');
$('#mergeBtn,#mergeBtnOther').show();
}
});
$("#mergingModalDiv").on("change", "#all_original_fields", function (e) {
if (this.checked === true) {
$(".original_radio").each(function() {
this.checked = true;
});
$(".duplicate_radio").each(function() {
this.checked = false;
});
$("#all_duplicate_fields").attr('checked', false);
} else {
$(".original_radio").each(function() {
this.checked = false;
});
}
});
$("#mergingModalDiv").on("change", "#all_duplicate_fields", function (e) {
if (this.checked === true) {
$(".duplicate_radio").each(function() {
this.checked = true;
});
$(".original_radio").each(function() {
this.checked = false;
});
$("#all_original_fields").attr('checked', false); //false for uncheck
} else {
$(".duplicate_radio").each(function() {
this.checked = false;
});
}
});
$("#selectMasterDialog").on("click", "#completeMerge", function (e) {
if(($("#all_original_fields").is(':checked') == false) && ($("#all_duplicate_fields").is(':checked') == false)){
alert("Please select which episode to keep");
e.preventDefault();
};
});
</script>
@endpush