 * limitations under the License.
 * 
 * Authors: Timur Vakhitov, Christian Reich, Eduard Korchmar
-* Date: 2020
+* Date: 2021
 **************************************************************************/
 
 --1. Update latest_update field to new date

	pVocabularyName			=> 'ICD10PCS',
	pVocabularyDate			=> (SELECT vocabulary_date FROM sources.icd10pcs LIMIT 1),
	pVocabularyVersion		=> (SELECT vocabulary_version FROM sources.icd10pcs LIMIT 1),
	pVocabularyDevSchema	=> 'DEV_ICD10PCS'
);
END $_$;

--2. Truncate all working tables

	'ICD10PCS' AS vocabulary_id,
	4180186 AS language_concept_id
FROM sources.mrconso
left join concept_stage on
	concept_code = code and
	str = concept_name
WHERE
	sab = 'ICD10PCS' and
	concept_code is null
GROUP BY code,
	str;

