BioMedICUS 2.x included TagEx, a generalized system for creating matching rules using labels: https://github.com/nlpie/biomedicus/wiki/TagEx
TagEx relies on a similar data structure as MTAP labels so it should be relatively easy to simply port over to MTAP-java. Python functionality could be provided using a grpc service.