レセプトチェックで病名追加する場合など,診療していない日に病名を付けると,病名の開始日が診療した日ではなく,作業日の日付になってしまう。これを,最終診療日が設定されるように変更する。
client/DiagnosisDocument.java の編集
import 部分
////
import javax.swing.JMenuItem;
import java.awt.event.ActionEvent;
import open.dolphin.dto.DocumentSearchSpec;
import open.dolphin.infomodel.DocInfoModel;
変数宣言部分
////↓ 病名修飾語リスト
private static String[] DIAGNOSIS_PREP = {"右","左","両"};
private static String[] DIAGNOSIS_PREP_CODE = {"2056","2049","2057"};
private static String[] DIAGNOSIS_POST = {"の急性増悪","の二次感染","の再発","の術後","の治療後"};
private static String[] DIAGNOSIS_POST_CODE = {"8061","8069","8065","8048","8075"};
////↑
////↓ 最終受診日=今日受診している場合は今日,していないばあいは最後の受診日
private int lastVisit_year; ////
private int lastVisit_month;
private int lastVisit_day;
////↑
initialize() 部分
private void initialize() {
// コマンドボタンパネルを生成する
JPanel cmdPanel = createButtonPanel2();
・
・
// Preference から昇順降順を設定する
ascend = Project.getPreferences().getBoolean(Project.DIAGNOSIS_ASCENDING, false);
////↓ 最終受診日を調べる
String lastVisit;
String pvt = getContext().getPatientVisit().getPvtDateTrimTime(); // 今日受診していたら今日の日付,受診していなければ null。PvgDateTrimはTimeが日付でDateが時間
if (pvt == null) {
//今日の受診がない場合,DocumentHistory の table から読んでくる
DocumentHistoryView dhv = (DocumentHistoryView) getContext().getDocumentHistory().getPanel();
lastVisit = (String) dhv.getTable().getModel().getValueAt(0, 0); // 表の左上スミをキメ打ち
} else {
// 今日の受診がある場合は,今日をセット
lastVisit = pvt;
}
lastVisit_year = Integer.valueOf(lastVisit.substring(0,4));
lastVisit_month = Integer.valueOf(lastVisit.substring(5,7)) - 1; // gc では month は 0 から始まるので注意
lastVisit_day = Integer.valueOf(lastVisit.substring(8));
////↑
}
createDiagnosisPanel() 部分
private JPanel createDignosisPanel() {
・
・
public void setValueAt(Object value, int row, int col) {
・
・
case OUTCOME_COL:
// JComboBox から選択
・
・
// 疾患終了日を入れる
if (Project.getPreferences().getBoolean("autoOutcomeInput", false)) {
String val = entry.getEndDate();
if (val == null || val.equals("")) {
////↓ 転帰日の自動入力の基準日を,lastVisit にする
//GregorianCalendar gc = new GregorianCalendar();
GregorianCalendar gc = new GregorianCalendar(lastVisit_year, lastVisit_month, lastVisit_day);
////↑
・
・
// 疾患終了日を入れる
if (Project.getPreferences().getBoolean("autoOutcomeInput", false)) {
String val = entry.getEndDate();
if (val == null || val.equals("")) {
////↓ 転帰日の自動入力の基準日を,lastVisit にする
//GregorianCalendar gc = new GregorianCalendar();
GregorianCalendar gc = new GregorianCalendar(lastVisit_year, lastVisit_month, lastVisit_day);
////↑
insertStamp() 部分
private void insertStamp(StampModel sm, int row) {
if (sm != null) {
RegisteredDiagnosisModel module = (RegisteredDiagnosisModel) BeanUtils.xmlDecode(sm.getStampBytes());
// 今日の日付を疾患開始日として設定する
////↓疾患開始日を lastVisit に設定
//GregorianCalendar gc = new GregorianCalendar();
GregorianCalendar gc = new GregorianCalendar(lastVisit_year, lastVisit_month, lastVisit_day);
////↑
・
・