Code: Alles auswählen.
*--------------------------------------------------*
*Behandlungsdiagnosen mit vorhandener DRG-Kategorie*
*--------------------------------------------------*
ELSEIF NOT bhdia IS INITIAL AND
NOT drg_cat1 IS INITIAL.
SELECT falnr ewdia bhdia afdia endia fhdia khdia opdia lfdnr dia_link dkat1 dkey1 diadt diazt drg_category dtyp1 FROM ndia INTO TABLE ndia_tab
FOR ALL ENTRIES IN nbew_tab
WHERE falnr = nbew_tab-falnr
AND bhdia = 'X'
AND dkat1 IN sc_dkat
AND drg_category NE ''
AND storn = ''
AND dkey1 IN sc_dkey1.
*--------------------------------------------------*
*Behandlungsdiagnosen ohne vorhandene DRG-Kategorie*
*--------------------------------------------------*
ELSEIF NOT bhdia IS INITIAL AND "Behandlungsdiagnosen ohne vorhandene DRG-Kategorie
NOT drg_cat2 IS INITIAL.
SELECT falnr ewdia bhdia afdia endia fhdia khdia opdia lfdnr dia_link dkat1 dkey1 diadt diazt drg_category dtyp1 FROM ndia INTO TABLE ndia_tab
FOR ALL ENTRIES IN nbew_tab
WHERE falnr = nbew_tab-falnr
AND bhdia = 'X'
AND dkat1 IN sc_dkat
AND drg_category EQ ''
AND storn = ''
AND dkey1 IN sc_dkey1.
*--------------------------------------------------*
*Behandlungsdiagnosen mit+ohne DRG-Kategorie-------*
*--------------------------------------------------*
ELSEIF NOT bhdia IS INITIAL AND "Alle Behandlungsdiagnosen mit und ohne DRG-Kategorie
NOT drg_cat3 IS INITIAL.
SELECT falnr ewdia bhdia afdia endia fhdia khdia opdia lfdnr dia_link dkat1 dkey1 diadt diazt drg_category dtyp1 FROM ndia INTO TABLE ndia_tab
FOR ALL ENTRIES IN nbew_tab
WHERE falnr = nbew_tab-falnr
AND bhdia = 'X'
AND dkat1 IN sc_dkat
AND storn = ''
AND dkey1 IN sc_dkey1.
ENDIF.
ndia_filter_table( CHANGING ndia_tab = ndia_tab ).
*---------------------------------------------------------------------------------*
* *
*---------------------------------------------------------------------------------*
ENDMETHOD. "FILL_ndia_table
*----------------------------------------------------------------------------*
*----Nicht erwünschte Behandlungsdiagnosen aussortieren----------------------*
*----------------------------------------------------------------------------*
METHOD ndia_filter_table.
DATA ndias_line TYPE tndia_line.
DATA neu_ndia_line TYPE tndia_line.
TYPES tndias_tab TYPE STANDARD TABLE OF tndia_line.
TYPES tneu_ndia_tab TYPE STANDARD TABLE OF tndia_line.
DATA ndias_tab TYPE tndias_tab.
DATA neu_ndia_tab TYPE tneu_ndia_tab.
DATA ndia_line TYPE tndia_line.
ndias_tab = ndia_tab.
*------------------Ohne Nebendiagnosen--------------------*
IF bhdia IS NOT INITIAL AND sonstige IS INITIAL.
DELETE ndia_tab
WHERE
bhdia = 'X' AND
afdia = '' AND
endia = '' AND
fhdia = '' AND
khdia = '' AND
opdia = ''.
ENDIF.
*----------------Ohne Aufnahmediagnosen------------------*
IF bhdia IS NOT INITIAL AND afdia IS INITIAL.
DELETE ndia_tab
WHERE
bhdia = 'X' AND
afdia = 'X' AND
endia = '' AND
fhdia = '' AND
khdia = '' AND
opdia = ''.
ENDIF.
*--------------Ohne Entlassungsdiagnosen-----------------*
IF bhdia IS NOT INITIAL AND endia IS INITIAL.
DELETE ndia_tab
WHERE
bhdia = 'X' AND
afdia = '' AND
endia = 'X' AND
fhdia = '' AND
khdia = '' AND
opdia = ''.
ENDIF.
*-------------Ohne Fachabteilungsdiagnosen---------------*
IF bhdia IS NOT INITIAL AND fhdia IS INITIAL.
DELETE ndia_tab
WHERE
bhdia = 'X' AND
afdia = '' AND
endia = '' AND
fhdia = 'X' AND
khdia = '' AND
opdia = ''.
ENDIF.
*-------------Ohne Hauptdiagnosen------------------------*
IF bhdia IS NOT INITIAL AND khdia IS INITIAL.
DELETE ndia_tab
WHERE
bhdia = 'X' AND
afdia = '' AND
endia = '' AND
fhdia = '' AND
khdia = 'X' AND
opdia = ''.
ENDIF.
*-----------Ohne OP-Diagnosen----------------------------*
IF bhdia IS NOT INITIAL AND opdia IS INITIAL.
DELETE ndia_tab
WHERE
bhdia = 'X' AND
afdia = '' AND
endia = '' AND
fhdia = '' AND
khdia = '' AND
opdia = 'X'.
ENDIF.
*-----------Nur Aufnahmediagnosen-------------------------*
IF bhdia IS NOT INITIAL AND afdia IS NOT INITIAL
AND sonstige IS INITIAL
AND endia IS INITIAL
AND fhdia IS INITIAL
AND khdia IS INITIAL
AND opdia IS INITIAL.
DELETE ndia_tab
WHERE
afdia = ''.
*-----------Nur Entlassungsdiagnosen------------------------*
ELSEIF bhdia IS NOT INITIAL AND afdia IS INITIAL
AND sonstige IS INITIAL
AND endia IS NOT INITIAL
AND fhdia IS INITIAL
AND khdia IS INITIAL
AND opdia IS INITIAL.
DELETE ndia_tab
WHERE
endia = ''.
*-----------Nur Fachabteilungsdiagnosen-----------------------*
ELSEIF bhdia IS NOT INITIAL AND afdia IS INITIAL
AND sonstige IS INITIAL
AND endia IS INITIAL
AND fhdia IS NOT INITIAL
AND khdia IS INITIAL
AND opdia IS INITIAL.
DELETE ndia_tab
WHERE
fhdia = ''.
*-----------Nur Hauptdiagnosen--------------------------------*
ELSEIF bhdia IS NOT INITIAL AND afdia IS INITIAL
AND sonstige IS INITIAL
AND endia IS INITIAL
AND fhdia IS INITIAL
AND khdia IS NOT INITIAL
AND opdia IS INITIAL.
DELETE ndia_tab
WHERE
khdia = ''.
*-----------Nur OP-Diagnosen----------------------------------*
ELSEIF bhdia IS NOT INITIAL AND afdia IS INITIAL
AND sonstige IS INITIAL
AND endia IS INITIAL
AND fhdia IS INITIAL
AND khdia IS INITIAL
AND opdia IS NOT INITIAL.
DELETE ndia_tab
WHERE
opdia = ''.
*-----------Nur Nebendiagnosen---------------------------------*
ELSEIF bhdia IS NOT INITIAL AND sonstige IS NOT INITIAL
AND afdia IS INITIAL
AND endia IS INITIAL
AND fhdia IS INITIAL
AND khdia IS INITIAL
AND opdia IS INITIAL.
DELETE ndia_tab
WHERE
afdia NE ''.
DELETE ndia_tab
WHERE
endia NE ''.
DELETE ndia_tab
WHERE
fhdia NE ''.
DELETE ndia_tab
WHERE
khdia NE ''.
DELETE ndia_tab
WHERE
opdia NE ''.
*-----------Aufnahme+Einweisungsdiagnosen------------------------*
ELSEIF bhdia IS NOT INITIAL AND afdia IS NOT INITIAL
AND endia IS NOT INITIAL
AND sonstige IS INITIAL
AND fhdia IS INITIAL
AND khdia IS INITIAL
AND opdia IS INITIAL.
DELETE ndia_tab
WHERE
afdia NE 'X' AND
endia NE 'X'.
*-----------Aufnahme+Fachabtdiagnosen------------------------*
ELSEIF bhdia IS NOT INITIAL AND afdia IS NOT INITIAL
AND endia IS INITIAL
AND fhdia IS NOT INITIAL
AND sonstige IS INITIAL
AND khdia IS INITIAL
AND opdia IS INITIAL.
DELETE ndia_tab
WHERE
afdia NE 'X' AND
fhdia NE 'X'.
*-----------Aufnahme+Hauptdiagnosen------------------------*
ELSEIF bhdia IS NOT INITIAL AND afdia IS NOT INITIAL
AND endia IS INITIAL
AND fhdia IS INITIAL
AND sonstige IS INITIAL
AND khdia IS NOT INITIAL
AND opdia IS INITIAL.
DELETE ndia_tab
WHERE
afdia NE 'X' AND
khdia NE 'X'.
*-----------Aufnahme+Opdiagnosen------------------------*
ELSEIF bhdia IS NOT INITIAL AND afdia IS NOT INITIAL
AND endia IS INITIAL
AND fhdia IS INITIAL
AND sonstige IS INITIAL
AND khdia IS INITIAL
AND opdia IS NOT INITIAL.
DELETE ndia_tab
WHERE
afdia NE 'X' AND
opdia NE 'X'.
*-----------Aufnahme+Zusatzdiagnosen------------------------*
ELSEIF bhdia IS NOT INITIAL AND sonstige IS NOT INITIAL
AND afdia IS NOT INITIAL
AND endia IS INITIAL
AND fhdia IS INITIAL
AND khdia IS INITIAL
AND opdia IS INITIAL.
DELETE ndia_tab
WHERE
afdia NE 'X' AND
endia NE ''.
DELETE ndia_tab
WHERE
afdia NE 'X' AND
fhdia NE ''.
DELETE ndia_tab
WHERE
afdia NE 'X' AND
khdia NE ''.
DELETE ndia_tab
WHERE
afdia NE 'X' AND
opdia NE ''.
*-----------Fachabt+Einweisungsdiagnosen------------------------*
ELSEIF bhdia IS NOT INITIAL AND afdia IS INITIAL
AND endia IS NOT INITIAL
AND fhdia IS NOT INITIAL
AND sonstige IS INITIAL
AND khdia IS INITIAL
AND opdia IS INITIAL.
DELETE ndia_tab
WHERE
endia NE 'X' AND
fhdia NE 'X'.
* ENDIF.
*-----------Haupt+Einweisungsdiagnosen------------------------*
ELSEIF bhdia IS NOT INITIAL AND afdia IS INITIAL
AND endia IS NOT INITIAL
AND fhdia IS INITIAL
AND sonstige IS INITIAL
AND khdia IS NOT INITIAL
AND opdia IS INITIAL.
DELETE ndia_tab
WHERE
endia NE 'X' AND
khdia NE 'X'.
* ENDIF.
*-----------OP+Einweisungsdiagnosen------------------------*
ELSEIF bhdia IS NOT INITIAL AND afdia IS INITIAL
AND endia IS NOT INITIAL
AND fhdia IS INITIAL
AND sonstige IS INITIAL
AND khdia IS INITIAL
AND opdia IS NOT INITIAL.
DELETE ndia_tab
WHERE
endia NE 'X' AND
opdia NE 'X'.
* ENDIF.
*-----------Zusatz+Einweisungsdiagnosen------------------------*
ELSEIF bhdia IS NOT INITIAL AND sonstige IS NOT INITIAL
AND afdia IS INITIAL
AND endia IS NOT INITIAL
AND fhdia IS INITIAL
AND khdia IS INITIAL
AND opdia IS INITIAL.
DELETE ndia_tab
WHERE
endia NE 'X' AND
afdia NE ''.
DELETE ndia_tab
WHERE
endia NE 'X' AND
fhdia NE ''.
DELETE ndia_tab
WHERE
endia NE 'X' AND
khdia NE ''.
DELETE ndia_tab
WHERE
endia NE 'X' AND
opdia NE ''.
* ENDIF.
*-----------Fachabt+Hauptdiagnosen------------------------*
ELSEIF bhdia IS NOT INITIAL AND afdia IS INITIAL
AND endia IS INITIAL
AND fhdia IS NOT INITIAL
AND sonstige IS INITIAL
AND khdia IS NOT INITIAL
AND opdia IS INITIAL.
DELETE ndia_tab
WHERE
fhdia NE 'X' AND
khdia NE 'X'.
* ENDIF.
*-----------Fachabt+Opdiagnosen------------------------*
ELSEIF bhdia IS NOT INITIAL AND afdia IS INITIAL
AND endia IS INITIAL
AND fhdia IS NOT INITIAL
AND sonstige IS INITIAL
AND khdia IS INITIAL
AND opdia IS NOT INITIAL.
DELETE ndia_tab
WHERE
fhdia NE 'X' AND
opdia NE 'X'.
* ENDIF.
*-----------Fachabt+Zusatzdiagnosen------------------------*
ELSEIF bhdia IS NOT INITIAL AND sonstige IS NOT INITIAL
AND afdia IS INITIAL
AND endia IS INITIAL
AND fhdia IS NOT INITIAL
AND khdia IS INITIAL
AND opdia IS INITIAL.
DELETE ndia_tab
WHERE
fhdia NE 'X' AND
afdia NE ''.
DELETE ndia_tab
WHERE
fhdia NE 'X' AND
endia NE ''.
DELETE ndia_tab
WHERE
fhdia NE 'X' AND
khdia NE ''.
DELETE ndia_tab
WHERE
fhdia NE 'X' AND
opdia NE ''.
* ENDIF.
*-----------OP+Hauptdiagnosen------------------------*
ELSEIF bhdia IS NOT INITIAL AND afdia IS INITIAL
AND endia IS INITIAL
AND fhdia IS INITIAL
AND sonstige IS INITIAL
AND khdia IS NOT INITIAL
AND opdia IS NOT INITIAL.
DELETE ndia_tab
WHERE
khdia NE 'X' AND
opdia NE 'X'.
* ENDIF.
*-----------Zusatz+Hauptdiagnosen------------------------*
ELSEIF bhdia IS NOT INITIAL AND sonstige IS NOT INITIAL
AND afdia IS INITIAL
AND endia IS INITIAL
AND fhdia IS INITIAL
AND khdia IS NOT INITIAL
AND opdia IS INITIAL.
DELETE ndia_tab
WHERE
khdia NE 'X' AND
afdia NE ''.
DELETE ndia_tab
WHERE
khdia NE 'X' AND
endia NE ''.
DELETE ndia_tab
WHERE
khdia NE 'X' AND
fhdia NE ''.
DELETE ndia_tab
WHERE
khdia NE 'X' AND
opdia NE ''.
* ENDIF.
*-----------Zusatz+Opdiagnosen------------------------*
ELSEIF bhdia IS NOT INITIAL AND sonstige IS NOT INITIAL
AND afdia IS INITIAL
AND endia IS INITIAL
AND fhdia IS INITIAL
AND khdia IS INITIAL
AND opdia IS NOT INITIAL.
DELETE ndia_tab
WHERE
opdia NE 'X' AND
afdia NE ''.
DELETE ndia_tab
WHERE
opdia NE 'X' AND
endia NE ''.
DELETE ndia_tab
WHERE
opdia NE 'X' AND
fhdia NE ''.
DELETE ndia_tab
WHERE
opdia NE 'X' AND
khdia NE ''.
* ENDIF.
*-----------Aufnahme+Entlassungs+Fachabtdiagnosen---------*
ELSEIF bhdia IS NOT INITIAL AND afdia IS NOT INITIAL
AND endia IS NOT INITIAL
AND fhdia IS NOT INITIAL
AND sonstige IS INITIAL
AND khdia IS INITIAL
AND opdia IS INITIAL.
DELETE ndia_tab
WHERE
afdia NE 'X' AND
endia NE 'X' AND
fhdia NE 'X'.
* ENDIF.
*-----------Aufnahme+Entlassungs+Hauptdiagnosen---------*
ELSEIF bhdia IS NOT INITIAL AND afdia IS NOT INITIAL
AND endia IS NOT INITIAL
AND fhdia IS INITIAL
AND sonstige IS INITIAL
AND khdia IS NOT INITIAL
AND opdia IS INITIAL.
DELETE ndia_tab
WHERE
afdia NE 'X' AND
endia NE 'X' AND
khdia NE 'X'.
* ENDIF.
*-----------Aufnahme+Entlassungs+Opdiagnosen---------*
ELSEIF bhdia IS NOT INITIAL AND afdia IS NOT INITIAL
AND endia IS NOT INITIAL
AND fhdia IS INITIAL
AND sonstige IS INITIAL
AND khdia IS INITIAL
AND opdia IS NOT INITIAL.
DELETE ndia_tab
WHERE
afdia NE 'X' AND
endia NE 'X' AND
opdia NE 'X'.
* ENDIF.
*-----------Aufnahme+Entlassungs+Zusatzdiagnosen---------*
ELSEIF bhdia IS NOT INITIAL AND afdia IS NOT INITIAL
AND endia IS NOT INITIAL
AND fhdia IS INITIAL
AND sonstige IS NOT INITIAL
AND khdia IS INITIAL
AND opdia IS INITIAL.
DELETE ndia_tab
WHERE
afdia NE 'X' AND
endia NE 'X' AND
fhdia NE ''.
DELETE ndia_tab
WHERE
afdia NE 'X' AND
endia NE 'X' AND
opdia NE ''.
DELETE ndia_tab
WHERE
afdia NE 'X' AND
endia NE 'X' AND
khdia NE ''.
* ENDIF.
*-----------Aufnahme+Haupt+Fachabtdiagnosen---------*
ELSEIF bhdia IS NOT INITIAL AND afdia IS NOT INITIAL
AND endia IS INITIAL
AND fhdia IS NOT INITIAL
AND sonstige IS INITIAL
AND khdia IS NOT INITIAL
AND opdia IS INITIAL.
DELETE ndia_tab
WHERE
afdia NE 'X' AND
fhdia NE 'X' AND
khdia NE 'X'.
* ENDIF.
*-----------Aufnahme+OP+Fachabtdiagnosen---------*
ELSEIF bhdia IS NOT INITIAL AND afdia IS NOT INITIAL
AND endia IS INITIAL
AND fhdia IS NOT INITIAL
AND sonstige IS INITIAL
AND khdia IS INITIAL
AND opdia IS NOT INITIAL.
DELETE ndia_tab
WHERE
afdia NE 'X' AND
fhdia NE 'X' AND
opdia NE 'X'.
* ENDIF.
*-----------Aufnahme+Zusatz+Fachabtdiagnosen---------*
ELSEIF bhdia IS NOT INITIAL AND afdia IS NOT INITIAL
AND endia IS INITIAL
AND fhdia IS NOT INITIAL
AND sonstige IS NOT INITIAL
AND khdia IS INITIAL
AND opdia IS INITIAL.
DELETE ndia_tab
WHERE
afdia NE 'X' AND
fhdia NE 'X' AND
endia NE ''.
DELETE ndia_tab
WHERE
afdia NE 'X' AND
fhdia NE 'X' AND
khdia NE ''.
DELETE ndia_tab
WHERE
afdia NE 'X' AND
fhdia NE 'X' AND
opdia NE ''.
* ENDIF.
*-----------Aufnahme+Haupt+Opdiagnosen---------*
ELSEIF bhdia IS NOT INITIAL AND afdia IS NOT INITIAL
AND endia IS INITIAL
AND fhdia IS INITIAL
AND sonstige IS INITIAL
AND khdia IS NOT INITIAL
AND opdia IS NOT INITIAL.
DELETE ndia_tab
WHERE
afdia NE 'X' AND
khdia NE 'X' AND
opdia NE 'X'.
* ENDIF.
*-----------Aufnahme+Haupt+Zusatzdiagnosen---------*
ELSEIF bhdia IS NOT INITIAL AND afdia IS NOT INITIAL
AND endia IS INITIAL
AND fhdia IS INITIAL
AND sonstige IS NOT INITIAL
AND khdia IS NOT INITIAL
AND opdia IS INITIAL.
DELETE ndia_tab
WHERE
afdia NE 'X' AND
khdia NE 'X' AND
endia NE ''.
DELETE ndia_tab
WHERE
afdia NE 'X' AND
khdia NE 'X' AND
fhdia NE ''.
DELETE ndia_tab
WHERE
afdia NE 'X' AND
khdia NE 'X' AND
opdia NE ''.
* ENDIF.
*-----------Aufnahme+OP+Zusatzdiagnosen---------*
ELSEIF bhdia IS NOT INITIAL AND afdia IS NOT INITIAL
AND endia IS INITIAL
AND fhdia IS INITIAL
AND sonstige IS NOT INITIAL
AND khdia IS INITIAL
AND opdia IS NOT INITIAL.
DELETE ndia_tab
WHERE
afdia NE 'X' AND
opdia NE 'X' AND
endia NE ''.
DELETE ndia_tab
WHERE
afdia NE 'X' AND
opdia NE 'X' AND
fhdia NE ''.
DELETE ndia_tab
WHERE
afdia NE 'X' AND
opdia NE 'X' AND
khdia NE ''.
* ENDIF.
*-----------Entlassung+Fachabt+Hauptdiagnosen---------*
ELSEIF bhdia IS NOT INITIAL AND afdia IS INITIAL
AND endia IS NOT INITIAL
AND fhdia IS NOT INITIAL
AND sonstige IS INITIAL
AND khdia IS NOT INITIAL
AND opdia IS INITIAL.
DELETE ndia_tab
WHERE
endia NE 'X' AND
fhdia NE 'X' AND
khdia NE 'X'.
* ENDIF.
*-----------Entlassung+Fachabt+Opdiagnosen---------*
ELSEIF bhdia IS NOT INITIAL AND afdia IS INITIAL
AND endia IS NOT INITIAL
AND fhdia IS NOT INITIAL
AND sonstige IS INITIAL
AND khdia IS INITIAL
AND opdia IS NOT INITIAL.
DELETE ndia_tab
WHERE
endia NE 'X' AND
fhdia NE 'X' AND
opdia NE 'X'.
* ENDIF.
*-----------Entlassung+Fachabt+Zusatzdiagnosen---------*
ELSEIF bhdia IS NOT INITIAL AND afdia IS INITIAL
AND endia IS NOT INITIAL
AND fhdia IS NOT INITIAL
AND sonstige IS NOT INITIAL
AND khdia IS INITIAL
AND opdia IS INITIAL.
DELETE ndia_tab
WHERE
endia NE 'X' AND
fhdia NE 'X' AND
afdia NE ''.
DELETE ndia_tab
WHERE
endia NE 'X' AND
fhdia NE 'X' AND
khdia NE ''.
DELETE ndia_tab
WHERE
endia NE 'X' AND
fhdia NE 'X' AND
opdia NE ''.
* ENDIF.
*-----------Entlassung+Haupt+Opdiagnosen---------*
ELSEIF bhdia IS NOT INITIAL AND afdia IS INITIAL
AND endia IS NOT INITIAL
AND fhdia IS INITIAL
AND sonstige IS INITIAL
AND khdia IS NOT INITIAL
AND opdia IS NOT INITIAL.
DELETE ndia_tab
WHERE
endia NE 'X' AND
khdia NE 'X' AND
opdia NE 'X'.
* ENDIF.
*-----------Entlassung+Haupt+Zusatzdiagnosen---------*
ELSEIF bhdia IS NOT INITIAL AND afdia IS INITIAL
AND endia IS NOT INITIAL
AND fhdia IS INITIAL
AND sonstige IS NOT INITIAL
AND khdia IS NOT INITIAL
AND opdia IS INITIAL.
DELETE ndia_tab
WHERE
endia NE 'X' AND
khdia NE 'X' AND
afdia NE ''.
DELETE ndia_tab
WHERE
endia NE 'X' AND
khdia NE 'X' AND
fhdia NE ''.
DELETE ndia_tab
WHERE
endia NE 'X' AND
khdia NE 'X' AND
opdia NE ''.
* ENDIF.
*-----------Entlassung+OP+Zusatzdiagnosen---------*
ELSEIF bhdia IS NOT INITIAL AND afdia IS INITIAL
AND endia IS NOT INITIAL
AND fhdia IS INITIAL
AND sonstige IS NOT INITIAL
AND khdia IS INITIAL
AND opdia IS NOT INITIAL.
DELETE ndia_tab
WHERE
endia NE 'X' AND
opdia NE 'X' AND
afdia NE ''.
DELETE ndia_tab
WHERE
endia NE 'X' AND
khdia NE 'X' AND
fhdia NE ''.
DELETE ndia_tab
WHERE
endia NE 'X' AND
khdia NE 'X' AND
opdia NE ''.
* ENDIF.
*-----------Fachabt+Haupt+Opdiagnosen---------------*
ELSEIF bhdia IS NOT INITIAL AND afdia IS INITIAL
AND endia IS INITIAL
AND fhdia IS NOT INITIAL
AND sonstige IS INITIAL
AND khdia IS NOT INITIAL
AND opdia IS NOT INITIAL.
DELETE ndia_tab
WHERE
fhdia NE 'X' AND
khdia NE 'X' AND
opdia NE 'X'.
* ENDIF.
*-----------Fachabt+Haupt+Zusatzdiagnosen-----------*
ELSEIF bhdia IS NOT INITIAL AND afdia IS INITIAL
AND endia IS INITIAL
AND fhdia IS NOT INITIAL
AND sonstige IS NOT INITIAL
AND khdia IS NOT INITIAL
AND opdia IS INITIAL.
DELETE ndia_tab
WHERE
fhdia NE 'X' AND
khdia NE 'X' AND
afdia NE ''.
DELETE ndia_tab
WHERE
fhdia NE 'X' AND
khdia NE 'X' AND
endia NE ''.
DELETE ndia_tab
WHERE
fhdia NE 'X' AND
khdia NE 'X' AND
opdia NE ''.
* ENDIF.
*-----------Fachabt+Op+Zusatzdiagnosen-----------*
ELSEIF bhdia IS NOT INITIAL AND afdia IS INITIAL
AND endia IS INITIAL
AND fhdia IS NOT INITIAL
AND sonstige IS NOT INITIAL
AND khdia IS INITIAL
AND opdia IS NOT INITIAL.
DELETE ndia_tab
WHERE
fhdia NE 'X' AND
opdia NE 'X' AND
afdia NE ''.
DELETE ndia_tab
WHERE
fhdia NE 'X' AND
opdia NE 'X' AND
endia NE ''.
DELETE ndia_tab
WHERE
fhdia NE 'X' AND
opdia NE 'X' AND
khdia NE ''.
* ENDIF.
*-----------Haupt+Op+Zusatzdiagnosen-------------*
ELSEIF bhdia IS NOT INITIAL AND afdia IS INITIAL
AND endia IS INITIAL
AND fhdia IS INITIAL
AND sonstige IS NOT INITIAL
AND khdia IS NOT INITIAL
AND opdia IS NOT INITIAL.
DELETE ndia_tab
WHERE
khdia NE 'X' AND
opdia NE 'X' AND
afdia NE ''.
DELETE ndia_tab
WHERE
khdia NE 'X' AND
opdia NE 'X' AND
endia NE ''.
DELETE ndia_tab
WHERE
khdia NE 'X' AND
opdia NE 'X' AND
fhdia NE ''.
* ENDIF.
*-----------Aufnahme+Entlassung+Fachabt+Hauptdiagnosen---------*
IF bhdia IS NOT INITIAL AND afdia IS NOT INITIAL
AND endia IS NOT INITIAL
AND fhdia IS NOT INITIAL
AND sonstige IS INITIAL
AND khdia IS NOT INITIAL
AND opdia IS INITIAL.
DELETE ndia_tab
WHERE
afdia NE 'X' AND
endia NE 'X' AND
fhdia NE 'X' AND
khdia NE 'X'.
ENDIF.
*-----------Aufnahme+Entlassung+Fachabt+Opdiagnosen-----------*
ELSEIF bhdia IS NOT INITIAL AND afdia IS NOT INITIAL
AND endia IS NOT INITIAL
AND fhdia IS NOT INITIAL
AND sonstige IS INITIAL
AND khdia IS INITIAL
AND opdia IS NOT INITIAL.
DELETE ndia_tab
WHERE
afdia NE 'X' AND
endia NE 'X' AND
fhdia NE 'X' AND
opdia NE 'X'.
* ENDIF.
*-----------Aufnahme+Entlassung+Fachabt+Zusatzdiagnosen-----------*
ELSEIF bhdia IS NOT INITIAL AND afdia IS NOT INITIAL
AND endia IS NOT INITIAL
AND fhdia IS NOT INITIAL
AND sonstige IS NOT INITIAL
AND khdia IS INITIAL
AND opdia IS INITIAL.
DELETE ndia_tab
WHERE
afdia NE 'X' AND
endia NE 'X' AND
fhdia NE 'X' AND
khdia NE ''.
DELETE ndia_tab
WHERE
afdia NE 'X' AND
endia NE 'X' AND
fhdia NE 'X' AND
opdia NE ''.
* ENDIF.
*-----------Aufnahme+Entlassung+Haupt+Opdiagnosen-----------*
ELSEIF bhdia IS NOT INITIAL AND afdia IS NOT INITIAL
AND endia IS NOT INITIAL
AND fhdia IS INITIAL
AND sonstige IS INITIAL
AND khdia IS NOT INITIAL
AND opdia IS NOT INITIAL.
DELETE ndia_tab
WHERE
afdia NE 'X' AND
endia NE 'X' AND
khdia NE 'X' AND
opdia NE 'X'.
* ENDIF.
*-----------Aufnahme+Entlassung+Haupt+Zusatzdiagnosen-------*
ELSEIF bhdia IS NOT INITIAL AND afdia IS NOT INITIAL
AND endia IS NOT INITIAL
AND fhdia IS INITIAL
AND sonstige IS NOT INITIAL
AND khdia IS NOT INITIAL
AND opdia IS INITIAL.
DELETE ndia_tab
WHERE
afdia NE 'X' AND
endia NE 'X' AND
khdia NE 'X' AND
fhdia NE ''.
DELETE ndia_tab
WHERE
afdia NE 'X' AND
endia NE 'X' AND
khdia NE 'X' AND
opdia NE ''.
* ENDIF.
*-----------Aufnahme+Entlassung+Fachabt+Hauptdiagnosen-----------*
ELSEIF bhdia IS NOT INITIAL AND afdia IS NOT INITIAL
AND endia IS NOT INITIAL
AND fhdia IS INITIAL
AND sonstige IS NOT INITIAL
AND khdia IS INITIAL
AND opdia IS NOT INITIAL.
DELETE ndia_tab
WHERE
afdia NE 'X' AND
endia NE 'X' AND
opdia NE 'X' AND
fhdia NE ''.
DELETE ndia_tab
WHERE
afdia NE 'X' AND
endia NE 'X' AND
opdia NE 'X' AND
khdia NE ''.
* ENDIF.
*-----------Aufnahme+Fachabt+Haupt+Opdiagnosen-----------*
ELSEIF bhdia IS NOT INITIAL AND afdia IS NOT INITIAL
AND endia IS INITIAL
AND fhdia IS NOT INITIAL
AND sonstige IS INITIAL
AND khdia IS NOT INITIAL
AND opdia IS NOT INITIAL.
DELETE ndia_tab
WHERE
afdia NE 'X' AND
fhdia NE 'X' AND
khdia NE 'X' AND
opdia NE 'X'.
* ENDIF.
*-----------Aufnahme+Fachabt+Haupt+Zusatzdiagnosen-----------*
ELSEIF bhdia IS NOT INITIAL AND afdia IS NOT INITIAL
AND endia IS INITIAL
AND fhdia IS NOT INITIAL
AND sonstige IS NOT INITIAL
AND khdia IS NOT INITIAL
AND opdia IS INITIAL.
DELETE ndia_tab
WHERE
afdia NE 'X' AND
fhdia NE 'X' AND
khdia NE 'X' AND
endia NE ''.
DELETE ndia_tab
WHERE
afdia NE 'X' AND
fhdia NE 'X' AND
khdia NE 'X' AND
opdia NE ''.
* ENDIF.
*-----------Aufnahme+Fachabt+OP+Zusatzdiagnosen-----------*
ELSEIF bhdia IS NOT INITIAL AND afdia IS NOT INITIAL
AND endia IS INITIAL
AND fhdia IS NOT INITIAL
AND sonstige IS NOT INITIAL
AND khdia IS INITIAL
AND opdia IS NOT INITIAL.
DELETE ndia_tab
WHERE
afdia NE 'X' AND
fhdia NE 'X' AND
opdia NE 'X' AND
endia NE ''.
DELETE ndia_tab
WHERE
afdia NE 'X' AND
fhdia NE 'X' AND
opdia NE 'X' AND
khdia NE ''.
* ENDIF.
*-----------Aufnahme+Haupt+OP+Zusatzdiagnosen-----------*
ELSEIF bhdia IS NOT INITIAL AND afdia IS NOT INITIAL
AND endia IS INITIAL
AND fhdia IS INITIAL
AND sonstige IS NOT INITIAL
AND khdia IS NOT INITIAL
AND opdia IS NOT INITIAL.
DELETE ndia_tab
WHERE
afdia NE 'X' AND
khdia NE 'X' AND
opdia NE 'X' AND
endia NE ''.
DELETE ndia_tab
WHERE
afdia NE 'X' AND
khdia NE 'X' AND
opdia NE 'X' AND
fhdia NE ''.
* ENDIF.
*-----------Entlassung+Fachabt+Haupt+OPdiagnosen-----------*
ELSEIF bhdia IS NOT INITIAL AND afdia IS INITIAL
AND endia IS NOT INITIAL
AND fhdia IS NOT INITIAL
AND sonstige IS INITIAL
AND khdia IS NOT INITIAL
AND opdia IS NOT INITIAL.
DELETE ndia_tab
WHERE
endia NE 'X' AND
fhdia NE 'X' AND
khdia NE 'X' AND
opdia NE 'X'.
* ENDIF.
*-----------Entlassung+Fachabt+Haupt+Zusatzdiagnosen-----------*
ELSEIF bhdia IS NOT INITIAL AND afdia IS INITIAL
AND endia IS NOT INITIAL
AND fhdia IS NOT INITIAL
AND sonstige IS NOT INITIAL
AND khdia IS NOT INITIAL
AND opdia IS INITIAL.
DELETE ndia_tab
WHERE
endia NE 'X' AND
fhdia NE 'X' AND
khdia NE 'X' AND
afdia NE ''.
DELETE ndia_tab
WHERE
endia NE 'X' AND
fhdia NE 'X' AND
khdia NE 'X' AND
opdia NE ''.
* ENDIF.
*-----------Entlassung+Fachabt+OP+Zusatzdiagnosen-----------*
ELSEIF bhdia IS NOT INITIAL AND afdia IS INITIAL
AND endia IS NOT INITIAL
AND fhdia IS NOT INITIAL
AND sonstige IS NOT INITIAL
AND khdia IS INITIAL
AND opdia IS NOT INITIAL.
DELETE ndia_tab
WHERE
endia NE 'X' AND
fhdia NE 'X' AND
opdia NE 'X' AND
afdia NE ''.
DELETE ndia_tab
WHERE
endia NE 'X' AND
fhdia NE 'X' AND
opdia NE 'X' AND
khdia NE ''.
* ENDIF.
*-----------Entlassung+Fachabt+Haupt+Opdiagnosen---------*
ELSEIF bhdia IS NOT INITIAL AND afdia IS INITIAL
AND endia IS NOT INITIAL
AND fhdia IS INITIAL
AND sonstige IS NOT INITIAL
AND khdia IS NOT INITIAL
AND opdia IS NOT INITIAL.
DELETE ndia_tab
WHERE
endia NE 'X' AND
khdia NE 'X' AND
opdia NE 'X' AND
afdia NE ''.
DELETE ndia_tab
WHERE
endia NE 'X' AND
khdia NE 'X' AND
opdia NE 'X' AND
fhdia NE ''.
* ENDIF.
*-----------Fachabt+Haupt+Op+Zusatzdiagnosen---------*
ELSEIF bhdia IS NOT INITIAL AND afdia IS INITIAL
AND endia IS INITIAL
AND fhdia IS NOT INITIAL
AND sonstige IS NOT INITIAL
AND khdia IS NOT INITIAL
AND opdia IS NOT INITIAL.
DELETE ndia_tab
WHERE
fhdia NE 'X' AND
khdia NE 'X' AND
opdia NE 'X' AND
afdia NE ''.
DELETE ndia_tab
WHERE
fhdia NE 'X' AND
khdia NE 'X' AND
opdia NE 'X' AND
endia NE ''.
ENDIF.
neu_ndia_tab = ndia_tab.
LOOP AT ndia_tab INTO ndia_line.
IF ndia_line-dia_link IS NOT INITIAL.
READ TABLE neu_ndia_tab
WITH KEY falnr = ndia_line-falnr
lfdnr = ndia_line-dia_link
TRANSPORTING NO FIELDS.
IF sy-subrc NE 0.
LOOP AT ndias_tab INTO ndias_line
WHERE falnr = ndia_line-falnr
AND lfdnr = ndia_line-dia_link.
APPEND ndias_line TO neu_ndia_tab.
ENDLOOP.
ENDIF.
ENDIF.
LOOP AT ndias_tab INTO ndias_line
WHERE falnr = ndia_line-falnr
AND dia_link = ndia_line-lfdnr.
READ TABLE neu_ndia_tab
WITH KEY falnr = ndias_line-falnr
lfdnr = ndias_line-lfdnr
TRANSPORTING NO FIELDS.
IF sy-subrc NE 0.
APPEND ndias_line TO neu_ndia_tab.
ENDIF.
ENDLOOP.
ENDLOOP.
ndia_tab = neu_ndia_tab.
ENDMETHOD. "ndia_filter_table
Folgende Benutzer bedankten sich beim Autor a-dead-trousers für den Beitrag:
Rantantan
wenn ich ganz ehrlich sein soll, dann nicht ganz Unter Umständen kommst du hier mit einer dynamischen WHERE-Bedingung weiter, ich käme aber erst morgen Nachmittag dazu das bei uns mal auszuprobieren.Rantantan hat geschrieben: Hilft das fürs Verständnis?
Folgende Benutzer bedankten sich beim Autor Alexander D. für den Beitrag:
Rantantan
Code: Alles auswählen.
data: rt_bhdiap type range of bhdia,
rt_afdia type range of afdia,
rt_endia type range of endia,
rt_fhdia type range of fhdia,
rt_khdia type range of khdia,
rt_opdia type range of opdia,
RT_drg_category type range of drg_category......USW. USW...
***Evtl: clear: rt_bhdiap[], rt_afdia[], rt_endia[], rt_fhdia[], rt_khdia[], rt_opdia[].
.
If bhdia is not initial. " CHECKBOX ist angekreuzt
rt_bhdia-sign = 'I'.
rt_bhdia-option = 'EQ'.
rt_bhdia-low = abap_true. "'X"
clear rt_bhdia_high.
append rt_bhdia to rt_bhdia.
else.
clear: rt_bhdiap[]. " CHECKBOX ist NICHT angekreuzt
endif.
Fuer alle anderen RANGE Tabellen die gleiche Vorgehensweise
Auch fuer drg_cat1 und drg_cat2 und drg_cat3 anwenden!?!?
If opdia is not initial. " CHECKBOX ist angekreuzt
rt_opdia-sign = 'I'.
rt_opdia-option = 'EQ'.
rt_opdialow = abap_true. "'X"
clear rt_opdialow_high.
append rt_ opdia to rt_ opdia.
else.
clear: rt_ opdia[]. " CHECKBOX ist NICHT angekreuzt
endif.
*--------------------------------------------------*
*Behandlungsdiagnosen
*--------------------------------------------------*
SELECT falnr ewdia bhdia afdia endia fhdia khdia opdia lfdnr dia_link dkat1 dkey1 diadt diazt drg_category dtyp1 FROM ndia INTO TABLE ndia_tab
FOR ALL ENTRIES IN nbew_tab
WHERE falnr = nbew_tab-falnr
AND dkat1 IN sc_dkat
AND drg_category NE ''
AND storn = ''
AND dkey1 IN sc_dkey
AND bhdia in rt_bhdia
AND afdia in rt_afdia
AND endia in rt_endia
AND fhdia in rt_fhdia
AND opdia in rt_opdia.
Code: Alles auswählen.
PARAMETERS bhdia TYPE ndia-bhdia RADIOBUTTON GROUP rad2 USER-COMMAND bhd. "Nur Behandlungsdiagnose
SELECTION-SCREEN COMMENT 03(31) text-010 FOR FIELD bhdia.
SELECTION-SCREEN POSITION 34.
PARAMETERS ewdia TYPE ndia-ewdia RADIOBUTTON GROUP rad2. "Nur Einweisungsdiagnose
SELECTION-SCREEN COMMENT 35(30) text-011 FOR FIELD ewdia.
SELECTION-SCREEN POSITION 70.
PARAMETERS alle RADIOBUTTON GROUP rad2 DEFAULT 'X'. "Alle Diagnosen
SELECTION-SCREEN COMMENT 71(20) text-012 FOR FIELD alle.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK a03.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN BEGIN OF BLOCK a06 WITH FRAME TITLE text-a05.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN POSITION 01.
PARAMETERS drg_cat1 TYPE ndia-drg_category RADIOBUTTON GROUP rad3 MODIF ID bhd DEFAULT 'X'. "DRG-Kategorie
SELECTION-SCREEN COMMENT 03(23) FOR FIELD drg_cat1 MODIF ID bhd.
PARAMETERS drg_cat2 TYPE ndia-drg_category RADIOBUTTON GROUP rad3 MODIF ID bhd.
SELECTION-SCREEN COMMENT 30(30) FOR FIELD drg_cat2 MODIF ID bhd.
SELECTION-SCREEN POSITION 61.
PARAMETERS drg_cat3 TYPE ndia-drg_category RADIOBUTTON GROUP rad3 MODIF ID bhd. "DRG-Kategorie
SELECTION-SCREEN COMMENT 63(26) FOR FIELD drg_cat3 MODIF ID bhd.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK a06.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN BEGIN OF BLOCK a04 WITH FRAME TITLE text-a05.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN POSITION 01.
PARAMETERS afdia TYPE ndia-afdia AS CHECKBOX MODIF ID bhd DEFAULT 'X'. "Aufnahme-Diagnose
SELECTION-SCREEN COMMENT 03(18) FOR FIELD afdia MODIF ID bhd.
SELECTION-SCREEN POSITION 26.
PARAMETERS fhdia TYPE ndia-fhdia AS CHECKBOX MODIF ID bhd. "Fachabteilungshauptdiagnose
SELECTION-SCREEN COMMENT 27(27) FOR FIELD fhdia MODIF ID bhd.
SELECTION-SCREEN POSITION 57.
PARAMETERS khdia TYPE ndia-khdia AS CHECKBOX MODIF ID bhd. "Krankenhaushauptdiagnose
SELECTION-SCREEN COMMENT 58(24) FOR FIELD khdia MODIF ID bhd.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN POSITION 01.
PARAMETERS opdia TYPE ndia-opdia AS CHECKBOX MODIF ID bhd. "OP-Hauptdiagnose
SELECTION-SCREEN COMMENT 03(18) FOR FIELD opdia MODIF ID bhd.
SELECTION-SCREEN POSITION 26.
PARAMETERS endia TYPE ndia-endia AS CHECKBOX MODIF ID bhd. "Entlassungsdiagnose
SELECTION-SCREEN COMMENT 27(27) FOR FIELD endia MODIF ID bhd.
SELECTION-SCREEN POSITION 57.
PARAMETERS sonstige AS CHECKBOX MODIF ID bhd.
SELECTION-SCREEN COMMENT 60(27) FOR FIELD sonstige MODIF ID bhd.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK a04.
Code: Alles auswählen.
DATA: rt_afdia TYPE RANGE OF ndia-afdia,
rt_endia TYPE RANGE OF ndia-endia,
rt_fhdia TYPE RANGE OF ndia-fhdia,
rt_khdia TYPE RANGE OF ndia-khdia,
rt_opdia TYPE RANGE OF ndia-opdia.
IF afdia IS NOT INITIAL. " CHECKBOX ist angekreuzt
rt_afdia-sign = 'I'.
rt_afdia-option = 'EQ'.
rt_afdia-low = abap_true. "'X"
CLEAR rt_afdia_high.