|
@@ -31,66 +31,59 @@ if(!@$summaryView) {
|
|
<div class="point-table-container">
|
|
<div class="point-table-container">
|
|
|
|
|
|
@if(!@$summaryView && $patient->core_note_id !== $note->id && $ccSegment)
|
|
@if(!@$summaryView && $patient->core_note_id !== $note->id && $ccSegment)
|
|
- <div class="d-flex align-items-baseline">
|
|
|
|
- <div class="mb-2 font-weight-bold font-size-14 text-secondary">Chief Complaint</div>
|
|
|
|
|
|
+ <div class="d-flex align-items-baseline mb-3">
|
|
|
|
+ <div class="font-weight-bold font-size-14 text-secondary">Chief Complaint</div>
|
|
<span class="mx-2 text-secondary">|</span>
|
|
<span class="mx-2 text-secondary">|</span>
|
|
- <a href="#" class="regenerate-cc">Regenerate with relevant problems</a>
|
|
|
|
- </div>
|
|
|
|
-
|
|
|
|
- <?php
|
|
|
|
- $ccPoint = Point::where('added_in_note_id', $note->id)->where('category', 'CHIEF_COMPLAINT')->orderBy('id', 'DESC')->first();
|
|
|
|
- $parsed = null;
|
|
|
|
- if ($ccPoint && !!@$ccPoint->data) {
|
|
|
|
- $parsed = json_decode($ccPoint->data);
|
|
|
|
- }
|
|
|
|
- if(!$parsed || !@$parsed->free_text) {
|
|
|
|
- list($problemPoints, $counts) = Point::getPointsOfCategoryExtended($patient, 'PROBLEM', $note);
|
|
|
|
- $problemNames = [];
|
|
|
|
- foreach ($problemPoints as $problemPoint) {
|
|
|
|
- if($problemPoint->relevanceToNote($note)) {
|
|
|
|
- $problemNames[] = $problemPoint->data->name;
|
|
|
|
- }
|
|
|
|
|
|
+ <a href="#" class="regenerate-cc mr-2">Regenerate</a>
|
|
|
|
+ <?php
|
|
|
|
+ $ccPoint = Point::where('added_in_note_id', $note->id)->where('category', 'CHIEF_COMPLAINT')->orderBy('id', 'DESC')->first();
|
|
|
|
+ $parsed = null;
|
|
|
|
+ if ($ccPoint && !!@$ccPoint->data) {
|
|
|
|
+ $parsed = json_decode($ccPoint->data);
|
|
}
|
|
}
|
|
- $ccProblems = '';
|
|
|
|
- for($i = 0; $i < count($problemNames); $i++) {
|
|
|
|
- if($i > 0) {
|
|
|
|
- if($i === count($problemNames) - 1) {
|
|
|
|
- $ccProblems .= " and ";
|
|
|
|
|
|
+ if(!$parsed || !@$parsed->free_text) {
|
|
|
|
+ list($problemPoints, $counts) = Point::getPointsOfCategoryExtended($patient, 'PROBLEM', $note);
|
|
|
|
+ $problemNames = [];
|
|
|
|
+ foreach ($problemPoints as $problemPoint) {
|
|
|
|
+ if($problemPoint->relevanceToNote($note)) {
|
|
|
|
+ $problemNames[] = $problemPoint->data->name;
|
|
}
|
|
}
|
|
- else {
|
|
|
|
- $ccProblems .= ", ";
|
|
|
|
|
|
+ }
|
|
|
|
+ $ccProblems = '';
|
|
|
|
+ for($i = 0; $i < count($problemNames); $i++) {
|
|
|
|
+ if($i > 0) {
|
|
|
|
+ if($i === count($problemNames) - 1) {
|
|
|
|
+ $ccProblems .= " and ";
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ $ccProblems .= ", ";
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+ $ccProblems .= $problemNames[$i];
|
|
}
|
|
}
|
|
- $ccProblems .= $problemNames[$i];
|
|
|
|
|
|
+ $defaultCC = "Patient {$patient->name_first} {$patient->name_last} " .
|
|
|
|
+ "is a {$patient->age_in_years} year old" .
|
|
|
|
+ ($patient->sex ? ($patient->sex === 'F' ? ' female' : ($patient->sex === 'M' ? ' male' : ' ' . $patient->sex)) : '') .
|
|
|
|
+ ($ccProblems ? " with a history of {$ccProblems}" : "") .
|
|
|
|
+ ($note->new_or_fu_or_na === 'NEW' ? ' presenting for establishing care' : ' presenting for follow-up') .
|
|
|
|
+ ".";
|
|
|
|
+ $parsed = json_decode(json_encode([
|
|
|
|
+ "free_text" => $defaultCC
|
|
|
|
+ ]));
|
|
}
|
|
}
|
|
- $defaultCC = "Patient {$patient->name_first} {$patient->name_last} " .
|
|
|
|
- "is a {$patient->age_in_years} year old" .
|
|
|
|
- ($patient->sex ? ($patient->sex === 'F' ? ' female' : ($patient->sex === 'M' ? ' male' : ' ' . $patient->sex)) : '') .
|
|
|
|
- ($ccProblems ? " with a history of {$ccProblems}" : "") .
|
|
|
|
- ($note->new_or_fu_or_na === 'NEW' ? ' presenting for establishing care' : ' presenting for follow-up') .
|
|
|
|
- ".";
|
|
|
|
- $parsed = json_decode(json_encode([
|
|
|
|
- "free_text" => $defaultCC
|
|
|
|
- ]));
|
|
|
|
- }
|
|
|
|
- ?>
|
|
|
|
- <div visit-moe class="d-block">
|
|
|
|
- <form show="" url="/api/visitPoint/upsertNoteSingleton" class="mcp-theme-1" id="frm-cc-regenerate">
|
|
|
|
- <input type="hidden" name="segmentUid" value="{{$ccSegment->uid}}">
|
|
|
|
- <input type="hidden" name="category" value="CHIEF_COMPLAINT">
|
|
|
|
- <input type="hidden" name="data" value="">
|
|
|
|
- <div note-rte slim-rte
|
|
|
|
- class="form-group mb-2 border-left border-right rte-holder cc-generated"
|
|
|
|
- data-field-name="free_text"
|
|
|
|
- ><?= $parsed && @$parsed->free_text ? $parsed->free_text : '' ?></div>
|
|
|
|
- </form>
|
|
|
|
|
|
+ ?>
|
|
|
|
+ <div visit-moe class="d-inline-block flex-grow-1">
|
|
|
|
+ <form show="" url="/api/visitPoint/upsertNoteSingleton" class="mcp-theme-1" id="frm-cc-regenerate">
|
|
|
|
+ <input type="hidden" name="segmentUid" value="{{$ccSegment->uid}}">
|
|
|
|
+ <input type="hidden" name="category" value="CHIEF_COMPLAINT">
|
|
|
|
+ <input type="hidden" name="data" value="">
|
|
|
|
+ <div note-rte slim-rte
|
|
|
|
+ class="form-group mb-0 border-left border-right rte-holder cc-generated"
|
|
|
|
+ data-field-name="free_text"
|
|
|
|
+ ><?= $parsed && @$parsed->free_text ? $parsed->free_text : '' ?></div>
|
|
|
|
+ </form>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
-
|
|
|
|
- <hr class="m-neg-3 mt-3 mb-2">
|
|
|
|
- @endif
|
|
|
|
-
|
|
|
|
- @if(!@$summaryView)
|
|
|
|
- <div class="mb-2 font-weight-bold font-size-14 text-secondary">Problems</div>
|
|
|
|
@endif
|
|
@endif
|
|
|
|
|
|
<table class="table table-sm table-bordered bg-white mb-2 point-table read">
|
|
<table class="table table-sm table-bordered bg-white mb-2 point-table read">
|